Monday 13 April 2015

Username Availability Check using Ajax, Jquery and PHP

Live username checking (whether username exist or not) has become very helpful a part of registration system. I guess, normal registration could be a immense turn-off for everybody, as a result of users not solely need to reload the complete page once more and once more, however fields like word etc conjointly have to be compelled to be re-entered every-time. during this article, let’s find-out we will check username availability using ajax, php, mysql, jquery.

dbcontroller.php

connectDB();
  if(!empty($conn)) {
   $this->selectDB($conn);
  }
 }
 
 function connectDB() {
  $conn = mysql_connect($this->host,$this->user,$this->password);
  return $conn;
 }
 
 function selectDB($conn) {
  mysql_select_db($this->database,$conn);
 }
 
 function runQuery($query) {
  $result = mysql_query($query);
  while($row=mysql_fetch_assoc($result)) {
   $resultset[] = $row;
  }  
  if(!empty($resultset))
   return $resultset;
 }
 
 function numRows($query) {
  $result  = mysql_query($query);
  $rowcount = mysql_num_rows($result);
  return $rowcount; 
 }
}
?>

index.php







Share this post
  • Share to Facebook
  • Share to Twitter
  • Share to Google+
  • Share to Stumble Upon
  • Share to Evernote
  • Share to Blogger
  • Share to Email
  • Share to Yahoo Messenger
  • More...

0 comments

:) :-) :)) =)) :( :-( :(( :d :-d @-) :p :o :>) (o) [-( :-? (p) :-s (m) 8-) :-t :-b b-( :-# =p~ :-$ (b) (f) x-) (k) (h) (c) cheer

 
Posts RSSComments RSSBack to top
© 2015 Eraneed ∙ Designed by Templates Crowd
Released under Creative Commons 3.0 CC BY-NC 3.0