Jump to content

Curl Redirect Help


jjt327

Recommended Posts

Hey guys, I've been googling for hours and there are millions of threads similar, but none of which i can make sense of!

 

I am trying to automatically log into my 99designs.com account using curl in php. The problem is that I redirect to 99designs.com after logging in. I can log in, and display the code within my php page, but i can't actually get to 99designs.com

 

My code looks a little like this:

$params = "email=<myEmail>&password=<myPassword>&from=/login?from=%2F";

$ch = curl_init();
curl_setopt($ch,CURLOPT_POST,true);
curl_setopt($ch,CURLOPT_COOKIESESSION,true); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER,0);
curl_setopt($ch, CURLOPT_COOKIEFILE, 'cookies.txt'); 
curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookies.txt'); 
curl_setopt($ch, CURLOPT_URL,'https://99designs.com/login'); 
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); 
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_exec ($ch); 
curl_close ($ch); 

 

 

Any ideas what I'm missing?

 

Thanks.

Link to comment
https://forums.phpfreaks.com/topic/235926-curl-redirect-help/
Share on other sites

Not possible, you are starting a session through the computer serving the PHP script, which shouldn't translate over to your client machine.

 

You could possibly do this if your browser allowed a page from one site to set a cookie for another. This would be a major security hole though.

Link to comment
https://forums.phpfreaks.com/topic/235926-curl-redirect-help/#findComment-1213168
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.