adv Posted November 9, 2010 Share Posted November 9, 2010 hey i am trying to make a script that checks if the username exists or not but i have a problem <?php function doRequest($method, $url, $referer, $agent, $cookie, $vars) { $ch=curl_init(); curl_setopt($ch, CURLOPT_URL, $url); if($referer != "") { curl_setopt($ch, CURLOPT_REFERER, $referer); } curl_setopt($ch, CURLOPT_USERAGENT, $agent); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie); curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie); if ($method == 'POST') { curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $vars); } if (substr($url, 0, 5) == "https") { curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 1); } $data = curl_exec($ch); curl_close($ch); if ($data) { return $data; } else { return curl_error($ch); } } function get($url, $referer, $agent, $cookie) { return doRequest('GET', $url, $referer, $agent, $cookie, 'NULL'); } function post($url, $referer, $agent, $cookie, $vars) { return doRequest('POST', $url, $referer, $agent, $cookie, $vars); } $cookie ='cookie.txt'; $agent = "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)"; $url = 'http://mail.tiscali.it/cp/sso/Login.jsp?d=tiscali.it&fpp=197310647636'; $referer = 'https://mail.tiscali.it'; $url1='https://selfcare.tiscali.it/unit/selfcare/it_usersuggest?application=username_suggest&node=gid&us=asdadsadas&dY='; //$str = post($url, $referer, $agent, $cookie, $vars); $str=get($url,$referer,$agent,$cookie); // register $str1=get($url1,$referer,$agent,$cookie); // here is where i get the link with the user check but something doesnt work echo $str1; ?> i`m trying first to enter the site then the register page where u can check if a user exists or not <a class="b" href="javascript:verifyUserID();">Verifica disponibilità</a> that is link check this is the error i`m getting <html><body><h1>403 Forbidden</h1> Request forbidden by administrative rules. </body></html> Link to comment https://forums.phpfreaks.com/topic/218153-check-username/ Share on other sites More sharing options...
OldWest Posted November 9, 2010 Share Posted November 9, 2010 That looks like something on the servers end you are trying to connect to. It's possible their server is configured to not allow this type of external "reading" or pulling of data... Just my first thought on it. Link to comment https://forums.phpfreaks.com/topic/218153-check-username/#findComment-1132027 Share on other sites More sharing options...
adv Posted November 9, 2010 Author Share Posted November 9, 2010 thanks OldWest but i`m curious what are other opinions Link to comment https://forums.phpfreaks.com/topic/218153-check-username/#findComment-1132166 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.