Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

check_username

<?php
include 'config.php';

if(isset($_POST['username'])){
   $username = $_POST['username'];

   // Check username
   $sql = "select count(*) as allcount from users where username=$1";
   $result = pg_query_params($con, $sql, array($username));
   $row = pg_fetch_assoc($result);
   $count = $row['allcount'];

   $response = "<span style='color: green;'>Available</span>";
   if($count > 0){
      $response = "<span style='color: red;'>Not Available</span>";
   }

   echo $response;
   exit;
}
Source by makitweb.com #
 
PREVIOUS NEXT
Tagged:
ADD COMMENT
Topic
Name
6+4 =