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 6 of 6
  1. #1
    Join Date
    Oct 2006
    Location
    Northampton
    Posts
    694
    Tokens
    142

    Default [PHP] file_get_contents?

    I am trying to use the file_get_contents to check a variable in a different document however it's not checking the document (index.php) and then echo the result.

    Good-bye signature, I love <NOT ALLOWED NAME AT ALL> despite the infraction his last name got me.

    Free speech? Not anymore, you gotta' love this forum.

  2. #2
    Join Date
    Mar 2005
    Location
    Leeds
    Posts
    3,423
    Tokens
    0

    Latest Awards:

    Default

    I dont see how that code would work...

    PHP Code:
    <?php 
    $source 
    file_get_contents("index.php");
    if (
    eregi('Copyright 2007, all rights reserved',  $source)) {
    print(
    "Copyright present");
    }
    else{
    print(
    "Copyright not present");
    }
    ?>
    Try that

  3. #3
    Join Date
    Oct 2006
    Location
    Northampton
    Posts
    694
    Tokens
    142

    Default

    Works great, thanks Danny.
    Good-bye signature, I love <NOT ALLOWED NAME AT ALL> despite the infraction his last name got me.

    Free speech? Not anymore, you gotta' love this forum.

  4. #4
    Join Date
    Oct 2006
    Location
    Northampton
    Posts
    694
    Tokens
    142

    Default

    Is there anyway that it if the copyright is present that it will do nothing if not it will die and echo "Copyright not present"?
    Good-bye signature, I love <NOT ALLOWED NAME AT ALL> despite the infraction his last name got me.

    Free speech? Not anymore, you gotta' love this forum.

  5. #5
    Join Date
    Mar 2005
    Location
    Leeds
    Posts
    3,423
    Tokens
    0

    Latest Awards:

    Default

    PHP Code:
    <?php 
    $source 
    file_get_contents("index.php");
    if (!
    eregi('Copyright 2007, all rights reserved',  $source)) {
    exit(
    "Copyright not present");
    }
    ?>
    There

  6. #6
    Join Date
    Oct 2006
    Location
    Northampton
    Posts
    694
    Tokens
    142

    Default

    Many thanks again Danny.
    Good-bye signature, I love <NOT ALLOWED NAME AT ALL> despite the infraction his last name got me.

    Free speech? Not anymore, you gotta' love this forum.

Posting Permissions

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