drupalphp
-
Posts
3 -
Joined
-
Last visited
Posts posted by drupalphp
-
-
I can log in to the first page, but I cant log in to the second page, I assume something wrong with my cookies.
-
Hey guys I am new here, I am trying to Get from my Api,Im using curl in php to log into on one page and
then get another page passing all cookies from the first page along with you but I keep getting Access denied!!
$ch = curl_init(); curl_setopt($ch, CURLOPT_COOKIEJAR, "/tmp/cookieFileName"); curl_setopt($ch, CURLOPT_URL,"http://www.supersaas.com/api/users"); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, "?account=myname&password=mypassword"); ob_start(); // prevent any output curl_exec ($ch); // execute the curl command ob_end_clean(); // stop preventing output curl_close ($ch); unset($ch); $ch = curl_init(); curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); curl_setopt($ch, CURLOPT_COOKIEFILE, "/tmp/cookieFileName"); curl_setopt($ch, CURLOPT_URL,"http://www.supersaas.com/api/users?id=12"); $buf2 = curl_exec ($ch); curl_close ($ch); echo "<PRE>".htmlentities($buf2);
What's wrong with the code????
Login to on one page and then get another page Help!
in PHP Coding Help
Posted
This is my source code..
I can log in and pull the data manually, but it doesnt work with the code.. now when I log in to the first page it return xml file I use this url (http://www.supersaas.com/api/users?account=myname&password=mypassword)
, than I try to run a filler in order the get user id that I need ( curl_setopt($ch, CURLOPT_URL,"http://www.supersaas.com/api/users?id=12"); )
than I am getting " HTTP Basic: Access denied. ",
I hope it clear now, THANKS A LOT