Problems with PHP & cURL

Adrian11111

Newbie
Joined
Jan 7, 2012
Messages
1
Reaction score
0
Hello,
I am trying to build a script wich will log in automatically at this page: ( see the linkat the Edit Reason please)

The problem is that because of all js and stuff from there i can't get it working.

Anyone have any ideeas and suggestions?

PHP:
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, '{LINK FROM THE EDIT REASON}');
curl_setopt ($ch, CURLOPT_POST, 1);

//The value scrapped loc1
$password = "";
$email = "";
//Load the page and get the values here?

curl_setopt ($ch, CURLOPT_POSTFIELDS, '__EVENTTARGET=&__EVENTARGUMENT=&__VIEWSTATE='.$value_scraped1.'&__PREVIOUSPAGE='.$val2.'&__EVENTVALIDATION='.$val3.'&ctl00%24hfUILocale=en_US&ctl00%24txtProductSearchName=Product+Search&ctl00%24cpContent%24txtUserName='.$email.'&ctl00%24cpContent%24txtPassword='.$password.'&ctl00%24cpContent%24btnSignIn=Sign+In');
curl_setopt ($ch, CURLOPT_COOKIEJAR, 'cookie.txt');
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);


$store = curl_exec ($ch);
curl_setopt($ch, CURLOPT_URL, '{YOUR ACCOUNT LINK}');


$content = curl_exec ($ch);
echo $content;
curl_close ($ch); 

?>
This is what i have writed but it just do nothing.
 
Last edited:
1. Use Firefox addon Live HTTP header - you will see data send to the server when submiting form
2. curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); - could help
3. https:// address - google "curl SLL"
4. google "show curl error" - u will see more than nothing
5. almost always its good to set:
curl_setopt($ch, CURLOPT_REFERER, $reffer);
curl_setopt($ch, CURLOPT_USERAGENT, $agent);

$agent e.i. = "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)";
 
Back
Top