rw4dmin 0 Report post Posted June 22, 2006 If you'are lazy people like me. This script may help u. This script is to automated our login to some site.You must have cURL installed to use this script. <?php// INIT CURL$ch = curl_init();// SET URL FOR THE POST FORM LOGINcurl_setopt($ch, CURLOPT_URL, 'http://http://ww1.external-site.com/rg-erdr.php?_rpo=t ENABLE HTTP POSTcurl_setopt ($ch, CURLOPT_POST, 1);// SET POST PARAMETERS : FORM VALUES FOR EACH FIELDcurl_setopt ($ch, CURLOPT_POSTFIELDS, 'fieldname1=fieldvalue1&fieldname2=fieldvalue2');// IMITATE CLASSIC BROWSER'S BEHAVIOUR : HANDLE COOKIEScurl_setopt ($ch, CURLOPT_COOKIEJAR, 'cookie.txt');# Setting CURLOPT_RETURNTRANSFER variable to 1 will force cURL# not to print out the results of its query.# Instead, it will return the results as a string return value# from curl_exec() instead of the usual true/false.curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);// EXECUTE 1st REQUEST (FORM LOGIN)$store = curl_exec ($ch);// SET FILE TO DOWNLOADcurl_setopt($ch, CURLOPT_URL, 'http://http://ww1.external-site.com/rg-erdr.php?_rpo=t EXECUTE 2nd REQUEST (FILE DOWNLOAD)$content = curl_exec ($ch);// CLOSE CURLcurl_close ($ch); ?> Share this post Link to post Share on other sites
iGuest 3 Report post Posted December 12, 2007 Well done. I used this script to reverse engineer dynamic daily emails on my website in conjuction with jetable.Org to avoid getting spammed. Thanks! -Cliff Bennett Share this post Link to post Share on other sites
iGuest 3 Report post Posted October 5, 2008 Great Stuff Automatic Login Using Curl Wow, I've been through so many examples recently trying to login via curl and submit data to a database but could not get it to work due to cookies etc but this worked like a charm! I just wish I'd found your example 6-7 hours ago!! Thank you! -reply by denise Share this post Link to post Share on other sites
harrison858 0 Report post Posted October 29, 2008 OMG! That was exactly what I was looking for, and it took me forever to find a script.Thanks, now I will use it Share this post Link to post Share on other sites
iGuest 3 Report post Posted October 31, 2008 How we set cookie? Automatic Login Using Curl Replying to harrison858 Still not login by using is script -reply by Nasir Ali Shah Share this post Link to post Share on other sites
liod 0 Report post Posted October 31, 2008 Thank you brother.It`s a small script, but it very help me. Share this post Link to post Share on other sites
shadowx 0 Report post Posted November 1, 2008 AHA! youve answered a question i couldnt be bothered to ask!I needed to login to a page with a GET var to the page i want, then be redirected to the page i want (now logged in) and decrypt some text and i was getting stuck at sending POST vars but now it may be solved!Thanks!Nice code too Good use of comments! Share this post Link to post Share on other sites
iGuest 3 Report post Posted March 27, 2009 Username/PasswordAutomatic Login Using CurlHow do I designate a username and password to use in the Automatic Login Using cURL script? Share this post Link to post Share on other sites
iGuest 3 Report post Posted April 19, 2009 Great Code - Thanks!Automatic Login Using CurlThanks for the great code it was exactly what I needed to automate the crediting on my site for those annoying affiliate networks that refuse to use postback URLs! It couldn't have been more customized to fit my needs! Regards,Tom Guilleaume Share this post Link to post Share on other sites
iGuest 3 Report post Posted June 4, 2009 Clear Example Of Curl.Automatic Login Using CurlThis was my first time attempting Curl and with your concept it made it easy to understand. Thank you for your post with the code. -feedback by Mark Share this post Link to post Share on other sites
iGuest 3 Report post Posted September 19, 2009 hey,Thanks for script you wrote.It works for some system.For some system I receive message "Object moved to here.".Can you suggest me what could be the reason for this?-reply by vishal Share this post Link to post Share on other sites
iGuest 3 Report post Posted November 14, 2009 didnAutomatic Login Using Curl hi, the CURL script didn't word on nginx http server, anyone know how to fix this ? the nginx return 404 response (not found) Thanks -reply by sapta Share this post Link to post Share on other sites
iGuest 3 Report post Posted December 28, 2009 Regarding automatic login using curlAutomatic Login Using CurlHi there, whether cookie file path inclusion is compulsory or not..? Thanks, Ars Share this post Link to post Share on other sites
iGuest 3 Report post Posted March 16, 2010 curl auto login with webdav serverAutomatic Login Using CurlHi, I would like to know the possibilities to use the above script for WEBDAV log in. Webdav will ask for windows authentication. Can we override this using curl. Thanks in advance!! Vijay Share this post Link to post Share on other sites
jhbalaji 0 Report post Posted May 18, 2010 Hey!Where i need to insert the username and password Share this post Link to post Share on other sites