Discover Habbo's history
Treat yourself with a Secret Santa gift.... of a random Wiki page for you to start exploring Habbo's history!
Happy holidays!
Celebrate with us at Habbox on the hotel, on our Forum and right here!
Join Habbox!
One of us! One of us! Click here to see the roles you could take as part of the Habbox community!


Results 1 to 7 of 7

Thread: PHP Includes

  1. #1
    Join Date
    Sep 2006
    Location
    Doncaster, UK
    Posts
    4,081
    Tokens
    0

    Latest Awards:

    Default PHP Includes

    Is it possible to include just 1 line of a PHP file?
    Quote Originally Posted by Nain View Post
    i voted 'Not Sure' as im, not sure!

  2. #2
    Join Date
    Dec 2006
    Location
    Swindon
    Posts
    3,299
    Tokens
    215
    Habbo
    dunko

    Latest Awards:

    Default

    Why dont you just select that 1 line of the php code and replace the include with it

  3. #3
    Join Date
    Sep 2006
    Location
    Doncaster, UK
    Posts
    4,081
    Tokens
    0

    Latest Awards:

    Default

    Because this would be easier for what I want doing.
    Quote Originally Posted by Nain View Post
    i voted 'Not Sure' as im, not sure!

  4. #4
    Join Date
    Oct 2006
    Location
    Merseyside
    Posts
    2,335
    Tokens
    0

    Latest Awards:

    Default

    You could put the line into a new file and then use this code to show that line:

    PHP Code:
    <? include("Link to page here"?>

  5. #5
    Join Date
    Sep 2006
    Location
    Doncaster, UK
    Posts
    4,081
    Tokens
    0

    Latest Awards:

    Default

    I know I could do that, but I want to link it a specific line in a file - if it's possible.
    Quote Originally Posted by Nain View Post
    i voted 'Not Sure' as im, not sure!

  6. #6
    Join Date
    Aug 2004
    Location
    UK
    Posts
    11,283
    Tokens
    2,031

    Latest Awards:

    Default

    Well a way you can kinda do this (on a generated page is)

    $line = file("somedir/somefile.htm");
    echo $line['15'];

    From memoery, i think its the file command at least, i may have it confused im to lazy to check

    Basicaly it puts the file contents in to an array split by the lines. so just echo out the array segment of the line you want, in this case line 16 (note array starts at zero so take account of that)

  7. #7
    Join Date
    Nov 2005
    Posts
    807
    Tokens
    1,335

    Latest Awards:

    Default

    just use
    PHP Code:
    <?php
    $file 
    file("file.php");
    eval(
    $file[1]);
    ?>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •