Hello All,
I'm trying to post the login info to RC (viz., _user, _pass, _action et al) via a curl script with no changes done to any of the RC code (like rc/index.php). But am unable to get the RC mail dashboard (folders or left, mail pane in the center etc). Also the the address bar remains same with the url of the script which has the curl in it.
This is my CURL code:
--------------------------------
$url = "/rc/index.php";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$url); // set url to post to
curl_setopt($ch, CURLOPT_FAILONERROR, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); // allow redirects
curl_setopt($ch, CURLOPT_RETURNTRANSFER,0); // return into a variable
curl_setopt($ch, CURLOPT_TIMEOUT, 0); // times out after Ns
curl_setopt($ch, CURLOPT_POST, 1); // set POST method
curl_setopt($ch, CURLOPT_POSTFIELDS, "_user=".$_POST['uname']."&_pass=".$_POST['passwd']."&ajax=1&_action=login"); // add POST fields
curl_setopt($ch, CURLOPT_FAILONERROR, 0);
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_COOKIEFILE, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_exec($ch); // run the whole process
curl_close($ch);
----------------------------------------------
Can somebody tell me what am doing wrong?
Note: I'm interested in finding a solution to the problem of sending login info via a script to RC backend..curl is just a candidate..please let me know if any other (non-html) ways exist.
Thanks in advance