[thelist] Help with 'secure' site, pls

Maximillian Schwanekamp anaxamaxan at neptunewebworks.com
Wed May 12 17:02:09 CDT 2004


------------------------
He currently drops into a URL, hits LOGIN then hits ORDERS and then
saves that page to disk.
What I would like to do is create a PHP script that does all that for
him...
 - logs in
 - retrieves page contents
 - saves to disk (server, not client)
I can do all this except log in.
------------------------

Probably CURL will do the trick for you, if all you need to do is POST a
username/password to https://www.homier.com/security.asp?a=v and retrieve
the contents of that page.  The PHP manual is the place to start, but
googling will likely get you some tutorials.  Probably you'll get something
along the lines of this:
<?php

$mystr = "EMail=$my_email&passwd=$my_password";

curl_setopt( $ch, CURLOPT_URL,"https://www.homier.com/security.asp?a=v" );
curl_setopt( $ch, CURLOPT_POST, 1 );
curl_setopt( $ch, CURLOPT_RETURNTRANSFER , 1 ); // i.e. get the return data,
do not print it
curl_setopt( $ch, CURLOPT_POSTFIELDS, $mystr );

$response = @curl_exec( $ch ); // response is a string

curl_close( $ch );

?>

Not sure about a=v part in the URL...

Maximillian Von Schwanekamp
Dynamic Websites and E-Commerce
www.NeptuneWebworks.com
voice: 541-302-1438
fax: 208-730-6504





More information about the thelist mailing list