curl-and-php
Re: simple form filler problem
Date: Sun, 12 Aug 2007 11:47:06 -0600
Dave Fobare wrote:
> Under WAMP 1.7.2 on XP Pro, I'm trying to get the following simple form
> filler to work:
>
Try this:
$post['UserID'] = "myuserid"
$post['Password'] = "mypassword";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://www.mysite.com/privatelogin" );
curl_setopt($ch, CURLOPT_POST, 1 );
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$postResult = curl_exec($ch);
if (curl_errno($ch)) {
print curl_error($ch);
}
curl_close($ch);
print "$postResult";
php.net is a great resource for code snippets:
http://us2.php.net/manual/en/ref.curl.php
Mark
_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
Received on 2007-08-12