onenonly Posted October 9, 2007 Share Posted October 9, 2007 Is it possible to auto fill form with your information. Example: https://login.yahoo.com/config/mail?.intl=us Can I Log into there with my username and password from a php file and check if the word anoluck exist. Link to comment https://forums.phpfreaks.com/topic/72416-solved-auto-fill-forms/ Share on other sites More sharing options...
zq29 Posted October 9, 2007 Share Posted October 9, 2007 I believe this can be achieved with CURL Link to comment https://forums.phpfreaks.com/topic/72416-solved-auto-fill-forms/#findComment-365543 Share on other sites More sharing options...
onenonly Posted October 9, 2007 Author Share Posted October 9, 2007 how exactly? Link to comment https://forums.phpfreaks.com/topic/72416-solved-auto-fill-forms/#findComment-365751 Share on other sites More sharing options...
MadTechie Posted October 9, 2007 Share Posted October 9, 2007 using post fields.. something like this (untested) $URL = "http://example.com"; $POSTFIELDS = 'field1=111&field2=222'; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,$URL); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS,$POSTFIELDS); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); $result = curl_exec ($ch); curl_close ($ch); print $result; See CURL manual for full details Link to comment https://forums.phpfreaks.com/topic/72416-solved-auto-fill-forms/#findComment-365763 Share on other sites More sharing options...
MadTechie Posted October 9, 2007 Share Posted October 9, 2007 Sighs... not even a thanx...! Link to comment https://forums.phpfreaks.com/topic/72416-solved-auto-fill-forms/#findComment-365791 Share on other sites More sharing options...
onenonly Posted October 10, 2007 Author Share Posted October 10, 2007 opps so sorry but im very thankful but i kinda found it myself i didnt understand what u meant <?php /************************************* Copyright 2007 WageRank http://www.wagerank.com *************************************/ $username="YOURUSERNAMEGOESHERE"; $password="YOURPASSWORDGOESHERE"; //No need to edit below this line //This is the info I pulled out of the LiveHTTPHeaderWindow $loginURL = "http://technorati.com/login.php"; $loginFields = "username=$username&password=$password"; //Now we just submit the form to login hitForm($loginURL, $loginFields); //Here we add WageRank to our favorites $favoritesURL = "http://technorati.com/faves/$username"; $favoritesFields = "add=http%3A%2F%2Fwww.wagerank.com&tag=%22online+marketing%22+seo+sem+%22affiliate+marketing%22"; hitForm($favoritesURL, $favoritesFields, "http://technorati.com/faves/$username?add=http://www.wagerank.com"); //Now we load our list of favorites and display it. print hitPage("http://technorati.com/faves/$username"); //That's it! Below are the two function definitions we used. function hitPage($page) { $ch = curl_init(); curl_setopt($ch, CURLOPT_COOKIEJAR, "cookies.txt"); curl_setopt($ch, CURLOPT_COOKIEFILE, "cookies.txt"); curl_setopt($ch, CURLOPT_URL, $page); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $ret = curl_exec($ch); curl_close($ch); return $ret; } function hitForm($loginURL, $loginFields, $referer="") { $ch = curl_init(); curl_setopt($ch, CURLOPT_COOKIEJAR, "cookies.txt"); curl_setopt($ch, CURLOPT_COOKIEFILE, "cookies.txt"); curl_setopt($ch, CURLOPT_URL, $loginURL); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_REFERER, $referer); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $loginFields); $ret = curl_exec($ch); curl_close($ch); return $ret; } ?> Link to comment https://forums.phpfreaks.com/topic/72416-solved-auto-fill-forms/#findComment-365831 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.