SHARE
TWEET

Untitled

a guest Feb 19th, 2019 54 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $.ajax({
  2.        url: 'yourusernamecheckpage.php',
  3.        type:'post',
  4.        data:{'username':$('#yourusername').val()},
  5.        beforeSend:function(){
  6.             //do a loading msg..like checking..
  7.  
  8.        },
  9.        success:function(msg){
  10.        if(msg == 'ok'){
  11.         //username available
  12.        }else{
  13.         //username not available
  14.        }
  15.     },error:function(msg){
  16.  
  17.    alert(msg);
  18.    }    
  19.  
  20.  
  21.     });
  22.  
  23. //yourusernamecheckpage.php
  24. //you can get the username as $_POST['username']:
  25. //do your validation and
  26. echo 'ok';exit;
  27. //if available
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top