Jump to content

phpil

Members
  • Posts

    4
  • Joined

  • Last visited

phpil's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I'm not sure it has anything to do with the // in the html link. I really just need help.
  2. Sorry about the code tags. This is exactly what I have, edited with nano and run in a terminal on Mac and Linux. <?php $target = 'http://www.example.com/'; $file_handle = fopen($target, "r"); while(!feof($file_handle)) echo fgets($file_handle, 4096); fclose($file_handle); ?> I just added the <?php ?> tags, but still the same error. "Parse error: parse error in Command line code on line 1". I've tried in Mac and Linux, ran it with "php -r" in the command terminal.
  3. So far I've tried escaping, cat'ing, putting it into single quotes. http:\/\/www.example.com doesn't work either.
  4. I'm pretty new to php, not so new to programming. My problem is really simple, and seems almost impossible to search for. When I reference an html link, the // renders everything after http: as a comment. I'm trying to learn to write webbots. This is the first basic lesson of the book "Webbots, Spiders and Screenscrapers": $target = "http://www.example.com/index.html"; $file_handle = fopen($target, "r"); while(!feof($file_handle)) echo fgets($file_handle, 4096); fclose($file_handle); It fails on both my Linux machine and Mac. "Parse error: parse error in Command line code on line 1". In the editor (nano) I see that everything after http: in line 1 is highlighted as a comment. This is straight from the book. What am I doing wrong?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.