Hi Guys, I am working on a script that basically scrape the data after logging into a website, codes looks fine as it should be but still I am unable to get myself logged in with the correct username and password provided. All I want from someone is to modify my codes a little so that it can log into the website, the problem is arising due to the parameters provided in the POST request (I believe so!) Below are the codes that I am using to log in and scrape, I dont want to publish the URL of the site due to Search Engines reason so if you think that the codes are all fine and the problem is in POST request then please let me know and I will provide you the URL of the site to examine the POST parameters. Codes: <?php $id=$_POST['useridid']; $pass=$_POST['userpass']; $ch=login($id, $pass); $html=downloadUrl('http://www.urltosite.net/default.aspx', $ch); echo $html; function login($uid, $upass){ $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'http://siteurl.net/default.aspx'); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_REFERER, "http://siteurl.net/default.aspx"); // Login page require the referrer to be this page // Extracted POST data from firefox 'temper' plugin $postData='_EVENTTARGET=&_EVENTARGUMENT=&_VIEWSTATE=%2FwEPDwUKLTIwNjYwMzI4M2QYAQUeX19Db250cm9sc1JlcXVpcmVQb3N0QmFja0tleV9fFgEFCWJ0blN1Ym1pdPaePT27%2FxlhEZolRPmt%2FFXmJ6RQ&_EVENTVALIDATION=%2FwEWBAK1kNXEDgLs0bLrBgLs0fbZDALCi9reA7HfEIfSk84AFLhP2f4S34JVz%2Bip&TextBox1='.$uid.'&TextBox2='.$upass.'&btnSubmit.x=31&btnSubmit.y=11&Login=Login'; curl_setopt ($ch, CURLOPT_POSTFIELDS, $postData); curl_setopt ($ch, CURLOPT_COOKIEJAR, 'cookie.txt'); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1); $store = curl_exec ($ch); return $ch; } function downloadUrl($Url, $ch){ curl_setopt($ch, CURLOPT_URL, $Url); curl_setopt($ch, CURLOPT_POST, 0); curl_setopt($ch, CURLOPT_REFERER, "http://siteurl.net/default.aspx"); curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.18) Gecko/20110614 Firefox/3.6.18"); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_TIMEOUT, 100); $output = curl_exec($ch); return $output; } ?> PHP: