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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.