View Full Version : PHP driving me CRAZY. Halp!

Jeff Booth
01-14-2002, 05:20 PM
Ok, I need to get some data from a site that has cookies, so I cannot use FOpen because cookies crash it, so I am planning on using Lynx from the Linux Shell to get the data. Here is a sample of my code (with an example url)..

Now could anyone tell me why this isn't working and returning the options (below) instead of the desired page?

$theurl2 = "-accept_all_cookies -dump http://www.nukewinter.com";
$a1 = shell_exec("lynx " . escapeshellarg($theurl2));
echo $a1;

Ahh, someone please tell me why the hell that is returning:

-dump dump the first file to stdout and exit
-editor=EDITOR enable edit mode with specified editor
-emacskeys enable emacs-like key movement (off)
toggles compatibility with comm programs' scrollback
keys (may be incompatible with some curses packages) (off)
-error_file=FILE write the HTTP status code here
-force_empty_hrefless_a force HREF-less 'A' elements to be empty (close them as soon as they are seen) (off)
-force_html forces the first document to be interpreted as HTML (off)
-force_secure toggles forcing of the secure flag for SSL cookies (off)
-forms_options toggles forms-based vs old-style options menu (on)
-from toggle transmission of From headers (on)
-ftp disable ftp access (off)
-get_data user data for get forms, read from stdin,
terminated by '---' on a line
-head send a HEAD request (off)
-help print this usage message
hidden links: options are merge, listonly, or ignore
-historical toggles use of '>' or '-->' as a terminator for comments (off)
-homepage=URL set homepage separate from start page
-image_links toggles inclusion of links for all images (off)
-index=URL set the default index file to URL
-ismap toggles inclusion of ISMAP link

Why the hell is it returning the options instead of the page i specified.. I cannot find any reason why it is doing this! Halp me!

01-17-2002, 03:27 PM
Have you tried the Snoopy class, for PHP. Its got all the stuff you need to grab web pages, session data etc etc. Take a look on sourceforge for it. Its called Snoopy

Good luck ;)

Jeff Booth
01-17-2002, 03:42 PM
Had never heard of it before, I'll give it a look see =)

Btw I got the code working above, just so nobody replies if they see this message in the future.