#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2004
    Location
    Italy
    Posts
    10
    Rep Power
    0

    remote file manipulation


    Hi all
    I have two problems and I need help to solve them

    I want to open a remote file and extrapolate some informations from it. That file is formatted in order to emphasize the informations I need to read. Information directly follows a HTML commentation tag and precedes a \n char as shown below

    <!--THIS _IS_TO_NOTIFY_THAT_INFO_FOLLOWS-->This is info
    </A></TD>

    Could anyone tell me how to read it?

    Then...

    I use thisd code to open the file
    PHP Code:
    ....
    $rf_url="http://www.domain.com/some_dir/index.jhtml?param1=1&param2=2&param3=3";
    $handle fopen($rf_url,"r") or die("Error: could not open remote file");
    .... 
    The file seems to be opened correctly but I can't read nothing
    ...
    I tryed to execute this code
    PHP Code:

    $teststr 
    fgets($handle4096);
    echo 
    $teststr
    but it didn't show anything

    Any suggestions?

    Thanks in advance for helps
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Aug 2003
    Posts
    778
    Rep Power
    15
    Hi,

    If you are not seeing any output probably means that the 'die' command is being executed ;-)

    Just remove the die for the moment and have test the connection with a simple if condition. Also check to see if your php configuration allows open urls as files.

    all the best
    --
    http://www.raditha.com/megaupload/
    PHP file upload progress bar.
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2004
    Location
    Italy
    Posts
    10
    Rep Power
    0
    I don't think so..
    the rest of page is correctly shown...
    only strings obtained from fgets() are empty strings

    thanks for reply

IMN logo majestic logo threadwatch logo seochat tools logo