SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Hybrid View

  1. #1
    SitePoint Member cyber.saurus's Avatar
    Join Date
    Jun 2004
    Location
    Belgium
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    help on function file_get_contents

    Hello,

    When executing this script, the following message appears on screen before the output: $file = readdir($handle)

    <?PHP
    $urldata = file_get_contents "http://www.mysite.com/index.php");
    echo strip_tags($urldata);
    ?>

    This function is new to me, so is there a way to turn of this message or do I have to add some other statements before calling this function?

    Thanks in advance.

  2. #2
    SitePoint Zealot
    Join Date
    Jan 2004
    Location
    Stekene, Belgium
    Posts
    110
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Didn't you forget a ( in the file_get_contents call?
    Good artists copy, great artists steal (Picasso)

  3. #3
    SitePoint Addict loadx's Avatar
    Join Date
    Jul 2004
    Location
    Melbourne, VIC, Australia
    Posts
    221
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    if the function is new to you then why didn't you check the manual :P

    http://au.php.net/file_get_contents
    file_get_contents -- Reads entire file into a string
    Description
    string file_get_contents ( string filename [, bool use_include_path [, resource context]])


    Identical to file(), except that file_get_contents() returns the file in a string. On failure, file_get_contents() will return FALSE.

  4. #4
    SitePoint Member cyber.saurus's Avatar
    Join Date
    Jun 2004
    Location
    Belgium
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by fbronx
    Didn't you forget a ( in the file_get_contents call?
    You're right, small mistake in my post (but the source on my server was right)
    the function is:

    <?PHP
    $file = file_get_contents("http://www.mysite.com/index.php");
    $file = strip_tags($bestand);
    echo $file;
    ?>

    Problem stays the same. By the way: this funtion is new (PHP >= 4.3).

    Thanks for the reaction.

  5. #5
    SitePoint Member cyber.saurus's Avatar
    Join Date
    Jun 2004
    Location
    Belgium
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The problem is solved, my stupid mistake.

    My apologies and thanks 4 the reactions.


Bookmarks

Posting Permissions

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