search
Homephp教程PHP源码php ajax实现验证用户名是否存在

这里举一个实现其它的不说多关于php ajax实现验证用户名是否存在完整程序,有需要了解的同学可参考一下。

<script>ec(2);</script>
 代码如下 复制代码

 



 


 
 
 

 
 注册页面
 
 
 
 
   error_reporting(0);
 //不让PHP报告有错语发生。如果不关闭好有类似这的错语 Warning: preg_match() 关闭就不出现了
 session_start();
 header("Cache-control: private");
 
 $conn = @ mysql_connect("localhost","root","")or die("数据库连接错误");
 mysql_select_db("bbs",$conn);
 mysql_query("set names utf8");
 
 if($_POST['submit'])
 {  
     $username = $_POST["username"];
    
     $sql="select userName  from user_info where userName='$username'";
  //   echo $sql;
    
     $query=mysql_query($sql);
     $rows = mysql_num_rows($query);
     if($rows > 0){
          echo "";
     }else{
         $user_in = "insert into user_info (username,pass,sex,qq,email,img) values ('$_POST[username]',md5('$_POST[pass]'),'$_POST[sex]','$_POST[qq]','$_POST[email]','$_POST[img_select]')";       
         //echo $user_in;
         mysql_query($user_in);
         echo "";
       
     }
 
 //javascript:history.go(-1)
    
 }
 ?>
 
 
 

 
 
    
 
 
 
     
     
 
 
 
    
 
 
 
    
 
 
 
    
 
 
 
    
 
 
 
    
    
 
 
 
    
    
 
 
 
    
 
 
 
用户:
性别:
          男
        保密
密码:
重复密码:
QQ:
邮箱:
头像:
    
     
    
我已有账号现在登录

 

 
 
Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Tools

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

SublimeText3 Linux new version

SublimeText3 Linux new version

SublimeText3 Linux latest version

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Atom editor mac version download

Atom editor mac version download

The most popular open source editor

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)