I am trying to auto login to linked In using curls script. Below is my script $userAgent = 'Googlebot/2.1 (http://www.googlebot.com/bot.html)'; $ch = curl_init(); curl_setopt($ch, CURLOPT_USERAGENT, $userAgent); curl_setopt($ch, CURLOPT_URL, 'https://www.linkedin.com/secure/login'); curl_setopt ($ch, CURLOPT_POST, 1); curl_setopt ($ch, CURLOPT_POSTFIELDS, 'session_key=loginemail&session_password=password'); curl_setopt ($ch, CURLOPT_COOKIEJAR, 'cookie.txt'); curl_setopt($ch, CURLOPT_COOKIEFILE, "cookie.txt"); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1); // EXECUTE 1st REQUEST (FORM LOGIN) $store = curl_exec ($ch); this is giving the following error; Make sure you have cookies and Javascript enabled in your browser before signing in. Any one know what should be the issue?
Based on my experience in cURL I would suggest you to use Tamper Data and Web Developer addons in Firefox. I would have given you the script but i don't have a account on Linkedin so i cant make the script. I checked it with Tamper Data. You might not be able to login because in your POSTFIELD you haven't added the value of csrfToken. Open the source and search for "<input type="hidden" name="csrfToken" value= ". The value of this also needs to be passed. Use a preg_match and get it done. Thanks, uworks