Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Jul 2002
    Location
    Alcoy (Spain)
    Posts
    49
    Thanks
    0
    Thanked 0 Times in 0 Posts

    fopen problem with remote url

    I'm having problems with the fopen function while trying to open a remote url. The problem is that the function only gets part of the web.
    It is a big page, but i can only get until the javascript.

    The code i use is:

    $url = fopen("http://www.url.com","r");
    $content = fread($file,100000000);
    fclose($url);


    I use Windows Xp and Apache.

    Thank you.

  • #2
    Regular Coder
    Join Date
    May 2002
    Location
    Virginia, USA
    Posts
    620
    Thanks
    0
    Thanked 6 Times in 6 Posts
    try:
    PHP Code:
    <?php
    $content 
    "";
    $url fopen("http://www.url.com","r");
    while (!
    feof($url)) {
       
    $content .= fgets($url,1024);
    }
    fclose($url);
    ?>

  • #3
    New Coder
    Join Date
    Jul 2002
    Location
    Alcoy (Spain)
    Posts
    49
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thumbs up

    Thank you very much


  •  

    Posting Permissions

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