Jump to content
  • 0

ostatní [JS-HELP] Kontrola nicku v DB


MinecraftPlayer

Dotaz

čuste udělal sem si kontrolu nicku DB ale prostě to nefachá nenačítá se to sjukněte to ..

 

je to na principu že uživatel zadá do textboxu nick a ten se pak v souboru skontroluje jestli už neni v DB hned vám to pošlu

 

JS :

 

function check(nick) {

  $.get('control.php?nick=' + nick, function(data) {
   var now1=document.getElementById("notice").style.display;

   if(data=="NICK_USED"){
     if(now1=="none"){
       $("#notice").slideDown("slow");
     }
   }else{
     if(now1 !="none"){
       $("#notice").slideUp("slow");
   }
     }
 });

 

control.php :

 

<?

if($_GET['nick'])
{
@mysql_connect("","","");
@mysql_select_db("");
$result = mysql_query("SELECT * FROM users WHERE nick='".$_GET['nick']."'");

$numrows = @mysql_num_rows($result);
if($numrows  > 0)
{

echo"NICK_USED";
}

}





?>

 

 

díky za pomoc

 

}

Link to comment
Share on other sites

0 odpovědí na tuto otázku

Recommended Posts

There have been no answers to this question yet

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...