这是注册程序是一款当用户输入完用户名是,就会自动去数据库中查询用户要注册的用户名是否己经被注册了,如果是返回提示否则提示可以注册。
conn.php文件
- <html>
- <head>
- <meta http-equiv="content-type" content="text/html; charset=utf-8">
- <script >
- var xmlhttp
- function showhint(str)
- {
- if (str.length==0)
- {
- document.getelementbyid("txthint").innerhtml=""
- return
- }
- xmlhttp=getxmlhttpobject()
- if (xmlhttp==null)
- {
- alert ("browser does not support http request")
- return
- }
- xmlhttp.onreadystatechange=statechanged
- var geturl="conn.php?q="+str
- //sid是增加一个随机数 防止页面启用缓存技术·
- geturl=geturl+"&sid="+math.random()
- geturl=encodeuri(geturl);
- geturl=encodeuri(geturl);
- xmlhttp.open("get",geturl,true)
- xmlhttp.send(null)
- }
- function statechanged()
- {
- if (xmlhttp.readystate==4 || xmlhttp.readystate=="complete")
- {
- document.getelementbyid("txthint").innerhtml=xmlhttp.responsetext
- }
- }
- function getxmlhttpobject()
- {
- var xmlhttp=null;
- try
- {
- // firefox, opera 8.0+, safari
- xmlhttp=new xmlhttprequest();
- }
- catch (e)
- {
- // internet explorer
- try
- {
- xmlhttp=new activexobject("msxml2.xmlhttp");
- }
- catch (e)
- {
- xmlhttp=new activexobject("microsoft.xmlhttp");
- }
- }
- return xmlhttp;
- }
- </script>
- </head>
- <body bgcolor="#999999">
- <center>
- <form>
- <table>
- <tr>
- <td>用户名:</td>
- <td><input type="text" id="txt1" onkeyup="showhint(this.value)"></td>
- </tr>
- <tr align="center">
- <td colspan="2"><span id="txthint"></span></td>
- </tr>
- </table>
- </form>
- </center>
- </body>
- </html>
- <?php
- $q=$_get["q"];
- $q = urldecode($q);
- if (strlen($q) > 0)
- {
- $conn = @mysql_connect("localhost","root","1010") or die ("mysql连接错误");
- mysql_select_db("xin",$conn);
- mysql_query("set names 'utf8'");
- $sql = "select username from message where username = '$q'";
- $query = mysql_query($sql);
- @$row = mysql_fetch_array($query);
- if(!emptyempty($row['username']))
- {
- $response = "<font color=red>已经被注册!</font>";
- }else
- {
- $response = "<font color=blue>恭喜!可以注册!</font>";
- }
- echo $response;
- }
- ?>
数据库
- drop database if exists `xin`;
- create database `xin` /*!40100 default character set utf8 */;
- use `xin`;
- create table `message` (
- `id` int(11) not null auto_increment,
- `username` varchar(20) default null,
- primary key (`id`)
- ) engine=innodb auto_increment=2 default charset=utf8;
波比源码 – 精品源码模版分享 | www.bobi11.com
1. 本站所有资源来源于用户上传和网络,如有侵权请邮件联系站长!
2. 分享目的仅供大家学习和交流,您必须在下载后24小时内删除!
3. 不得使用于非法商业用途,不得违反国家法律。否则后果自负!
4. 本站提供的源码、模板、插件等等其他资源,都不包含技术服务请大家谅解!
5. 如有链接无法下载、失效或广告,请联系管理员处理!
6. 本站资源售价只是赞助,收取费用仅维持本站的日常运营所需!
7. 本站源码并不保证全部能正常使用,仅供有技术基础的人学习研究,请谨慎下载
8. 如遇到加密压缩包,请使用WINRAR解压,如遇到无法解压的请联系管理员!
波比源码 » php ajax注册验证用户名是否存在代码
波比源码 » php ajax注册验证用户名是否存在代码
levofloxacin sale levofloxacin online buy
purchase avodart online cheap brand tamsulosin 0.2mg ondansetron 4mg cheap
ampicillin usa order erythromycin 250mg for sale purchase erythromycin without prescription
buy fildena generic methocarbamol cost robaxin 500mg without prescription
order sildenafil 50mg pill order aurogra 100mg without prescription order estradiol 1mg pill
cost tadalafil tadalafil 10mg pills order diclofenac 100mg pills
isotretinoin price buy azithromycin without prescription order azithromycin 500mg online cheap
cialis mail order usa Free viagra sample sildenafil 25mg
isotretinoin cost azithromycin 250mg drug ivermectin malaria
buy altace 10mg without prescription order temovate generic azelastine sprayers
purchase clonidine online cheap buy minocin 50mg generic buy spiriva 9 mcg generic
buy alendronate generic order motrin generic order famotidine 40mg pill
olmesartan 20mg sale calan 240mg price buy acetazolamide 250mg pills
prograf tablet ropinirole without prescription urso 150mg over the counter
order imdur pill telmisartan 20mg without prescription buy telmisartan 20mg pills
buy dapsone sale adalat cost order aceon online
provigil 100mg sale generic stromectol for humans stromectol
fluvoxamine 100mg for sale buy nizoral 200mg without prescription buy glucotrol sale
order accutane 40mg online accutane 40mg us prednisone 40mg usa
furosemide for sale online plaquenil 400mg cheap buy hydroxychloroquine pill
sporanox over the counter buy tindamax 300mg pills buy tinidazole 300mg for sale
order zyprexa 10mg generic buy diovan 160mg for sale buy diovan 80mg generic
buy linezolid without prescription online casino bonus money poker online
buy metoprolol generic brand lopressor vardenafil online buy
buy baclofen 10mg sale baclofen online order buy ketorolac
gloperba sale buy colchicine pills online poker sites
cialis tadalafil 10mg buy cialis 10mg pill cipro 1000mg for sale
zocor 10mg without prescription valacyclovir 500mg over the counter oral propecia 5mg
order cialis 20mg pill order generic viagra 100mg sildenafil pills 50mg
desyrel 50mg drug sildenafil 50mg sale aurogra order
order research paper online purchase stromectol sale stromectol 3mg online
sildalis medication sildalis sale lamictal buy online
order prednisone 5mg without prescription order accutane 40mg for sale amoxicillin order online
viagra pills 25mg tadalafil without a doctor’s prescription cialis sale
win real money online casino stromectol 6mg uk buy generic provigil 100mg
order prednisone 20mg generic buy prednisone 10mg online cheap purchase mebendazole generic
tretinoin over the counter purchase avanafil generic purchase avana
order terbinafine 250mg for sale suprax 100mg sale cheap trimox 500mg
cheap actos 30mg cheap viagra generic viagra 50mg ca
montelukast order buy singulair 10mg online cheap viagra 100mg for sale
ivermectin 0.5% lotion order symmetrel 100mg sale generic dapsone 100 mg
poker online games san manuel casino online free online roulette
oral adalat oral nifedipine 30mg buy allegra online
help writing research paper leflunomide ca sulfasalazine 500 mg tablet
asacol ca buy astelin 10 ml online purchase irbesartan pills
carvedilol for sale order elavil sale amitriptyline 50mg tablet
fosamax 35mg for sale purchase alendronate online cheap order ibuprofen 600mg generic
famotidine order online buy remeron 30mg remeron for sale
usa cialis sales Cialis store sildenafil 150mg price
buy cialis 40mg online top ed drugs ed pills that work quickly
zofran 8mg ca purchase bactrim pills trimethoprim price
buy prednisolone 10mg for sale order gabapentin 100mg generic order furosemide for sale
azathioprine 50mg without prescription oral azathioprine 25mg naprosyn 500mg price
brand omnicef buy omnicef 300 mg online pantoprazole 20mg drug
dapsone drug dapsone 100 mg uk order atenolol 100mg online
alfuzosin without prescription trazodone 50mg ca buy diltiazem 180mg generic
sildenafil 100 mg sildenafil 100 mg buy cialis