jjt327 Posted May 9, 2011 Share Posted May 9, 2011 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. Quote Link to comment https://forums.phpfreaks.com/topic/235926-curl-redirect-help/ Share on other sites More sharing options...
jjt327 Posted May 9, 2011 Author Share Posted May 9, 2011 anyone? Quote Link to comment https://forums.phpfreaks.com/topic/235926-curl-redirect-help/#findComment-1213036 Share on other sites More sharing options...
requinix Posted May 9, 2011 Share Posted May 9, 2011 You mean to use cURL to log in to that site, and then redirect you (=your browser) to the site and have you logged in? Quote Link to comment https://forums.phpfreaks.com/topic/235926-curl-redirect-help/#findComment-1213043 Share on other sites More sharing options...
jjt327 Posted May 9, 2011 Author Share Posted May 9, 2011 Yes, this is correct. Quote Link to comment https://forums.phpfreaks.com/topic/235926-curl-redirect-help/#findComment-1213052 Share on other sites More sharing options...
jjt327 Posted May 10, 2011 Author Share Posted May 10, 2011 I'm guessing this can't be done then? Quote Link to comment https://forums.phpfreaks.com/topic/235926-curl-redirect-help/#findComment-1213165 Share on other sites More sharing options...
xyph Posted May 10, 2011 Share Posted May 10, 2011 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. Quote Link to comment https://forums.phpfreaks.com/topic/235926-curl-redirect-help/#findComment-1213168 Share on other sites More sharing options...
jjt327 Posted May 10, 2011 Author Share Posted May 10, 2011 Fair enough thanks for that. Anyone know how websites like www.clipperz.com achieve their automatic logins? Quote Link to comment https://forums.phpfreaks.com/topic/235926-curl-redirect-help/#findComment-1213181 Share on other sites More sharing options...
xyph Posted May 10, 2011 Share Posted May 10, 2011 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. Quote Link to comment https://forums.phpfreaks.com/topic/235926-curl-redirect-help/#findComment-1213453 Share on other sites More sharing options...
jjt327 Posted May 10, 2011 Author Share Posted May 10, 2011 Javascript huh? Is it a problem that the password has to be decrypted into plain text before submission in the form? Obviously this is insecure being javascript and all? Quote Link to comment https://forums.phpfreaks.com/topic/235926-curl-redirect-help/#findComment-1213496 Share on other sites More sharing options...
xyph Posted May 11, 2011 Share Posted May 11, 2011 Passwords are sent by plain text every time a user logs in, unless it's through a secure connection (https) Quote Link to comment https://forums.phpfreaks.com/topic/235926-curl-redirect-help/#findComment-1213890 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.