i wrote some php script that need to log into Pinterest but fails to log in: can you help to fix it ? <?php $login_email = 'user'; $login_pass = pass'; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://www.pinterest.com/login/'); curl_setopt($ch, CURLOPT_POSTFIELDS,'email='.urlencode($login_email).'&pass='.urlencode($login_pass)); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_COOKIEJAR, "cookies.txt"); curl_setopt($ch, CURLOPT_COOKIEFILE, "cookies.txt"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.3) Gecko/20070309 Firefox/2.0.0.3"); curl_setopt($ch, CURLOPT_REFERER, "https://www.pinterest.com/"); curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC ) ; curl_setopt($curl, CURLOPT_USERPWD, "admin171078@gmail.com:simon171078"); $page = curl_exec($ch); $output=@curl_exec($ch); $info = @curl_getinfo($ch); echo $output; print_r($info); ?> PHP:
As PoPSiCLe said, it would help to see some code. If not, checkout this thread on Stackoverflow: http://stackoverflow.com/questions/23568948/pinterest-login-with-php-and-curl-not-working
$login_email = 'user'; $login_pass = pass'; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'website/login/'); curl_setopt($ch, CURLOPT_POSTFIELDS,'email='.urlencode($login_email).'&pass='.urlencode($login_pass)); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_COOKIEJAR, "cookies.txt"); curl_setopt($ch, CURLOPT_COOKIEFILE, "cookies.txt"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.3) Gecko/20070309 Firefox/2.0.0.3"); curl_setopt($ch, CURLOPT_REFERER, "website"); curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC ) ; curl_setopt($curl, CURLOPT_USERPWD, "userass"); $page = curl_exec($ch); $output=@curl_exec($ch);
Yeah, see, you've done the same as the guy on the Stackoverflow thread. http://stackoverflow.com/questions/23568948/pinterest-login-with-php-and-curl-not-working That thread has a working example.