I'm trying to create a script for user to login into Paypal. I try :
$url="https://paypal.com/cgi-bin/webscr?dispatch=5885d80a13c0db1f941d8253416939c6899ae213b0cf474deda34198fd755846";
$error=$http->GetRequestArguments($url,$arguments);
$arguments["RequestMethod"]="POST"; $arguments["Header"]["Content-Type"]="application/x-www-form-urlencoded";
$arguments["PostValues"]=array (
"close_external_flow"=>"false",
"cmd"=>"_login-submit",
"login_cmd"=>"",
"login_params"=>"",
"login_cancel_cmd"=>"",
"login_email"=>"
[email protected]",
"login_password"=>"aaa",
"submit"=>"Log+In",
"form_charset"=>"UTF-8",
"iconix_installed"=>"0"
);
but this won't work, Paypal response "Page Not Found". But If I use an HTTP editor and try :
POST https://paypal.com/cgi-bin/webscr?dispatch=5885d80a13c0db1f941d8253416939c6899ae213b0cf474deda34198fd755846 HTTP/1.1
Content-Type: application/x-www-form-urlencoded
close_external_flow=false&cmd=_login-submit&login_cmd=&login_params=&login_cancel_cmd=&login_email=aa&login_password=aa&submit=Log+In&form_charset=UTF-8&iconix_installed=0
And the result is OK. So I modify the PHP code to :
$url="https://paypal.com/cgi-bin/webscr?dispatch=5885d80a13c0db1f941d8253416939c6899ae213b0cf474deda34198fd755846";
$error=$http->GetRequestArguments($url,$arguments);
$arguments["RequestMethod"]="GET"; $arguments["Header"]["Content-Type"]="application/x-www-form-urlencoded";
$arguments["Header"][""]="close_external_flow=false&cmd=_login-submit&login_cmd=&login_params=&login_cancel_cmd=&login_email=aa&login_password=aa&submit=Log+In&form_charset=UTF-8&iconix_installed=0";
And the result is the homepage of Paypal. This look like the :
close_external_flow=false&cmd=_login-submit&login_cmd=&login_params=&login_cancel_cmd=&login_email=aa&login_password=aa&submit=Log+In&form_charset=UTF-8&iconix_installed=0
hasn't been sent to the server. Can you give me a suggestion please ?