Jump to content

check username


adv

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.