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
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
Share on other sites

They probably store your password in with (i'd hope) a two way encryption. When you want to log in, it grabs it, and submits a form automatically with javascript. The action is the site's login page.

Link to comment
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.