Location: PHPKode > projects > MembersGear > membersgear/includes/ctl_isemailavailable.php
<?php
require_once("../config/config.php");
require_once(INCLUDE_DIR."/users_class.php");  
  
if(isset($_POST))
 {
    
   if(isset($_POST['email'])) 
    {
       
        $a = trim($_POST['email']);
        $b= $_POST['uid'];
        sleep(1);  
        $result=false;
        
        if($a!='')
        {    
            $users = new users_class();
            if($b!='' and strtoupper($b)!=strtoupper('undefined'))
            {
                $result = $users->view('select * from '.TABLE_PREFIX.'users where email=? and id!=? and session_id!=?',array(trim($a),$b,session_id()),null);  
                
            }
            else
            {
               $result = $users->view('select * from '.TABLE_PREFIX.'users where email=? and session_id!=?',array(trim($a),session_id()),null); 
            }    
            
            if(sizeof($result)>0 && is_array($result))
            {
                
                
                     echo 'already_exist';
                           exit;
                 
            }    
            else
            {    
                 if(preg_match("/^(?:[\w\d]+\.?)+@(?:(?:[\w\d]\-?)+\.)+\w{2,6}$/", $a))
                {
                    $result=true;
                    echo 'yes';
                    exit;
                    
                }
               else
                {
                    echo 'invalid_email';
                    exit;
                
                }    
                
            }
     
      }
      else
      {
          echo '';
           exit;
            
       }
       

    }
               
}   




/* Initiliaze php ajax*/

?>
Return current item: MembersGear