首先是 Ajax.php文件:
这个文件我觉着就是接收数据处理数据的
代码如下 | 复制代码 |
mysql_connect("localhost","root",""); |
上面的这些代码 不用我说都知道是连接数据库的
代码如下 | 复制代码 |
//select 语句 $q=mysql_query($sql); |
上面的1和2的选项是因为 我写了一遍select语句出现报错了 然后我就又写了一遍 结果两个都对了 1 是注释掉了
if(mysql_num_rows($q)!=0){ 判断查找的语句的个数 如果是0的话就代表下面没有分支了 就不会显示了
//记住在$_POST[]加()这是我出现的错误
代码如下 | 复制代码 |
echo " |
输出一个select选择框会添加到后来最终显示的页面的div里面 后面会做介绍
代码如下 | 复制代码 |
while($rs=mysql_fetch_array($q)){ } ?> |
--------------------------------------------------------------------------------
下面的是Ajax.js文件var xmlhttp;定义一个变量
代码如下 | 复制代码 |
function createxml(){这个部分主要是用来判断浏览器 |
--------------------------------------------------------------------------------
下面是展示页面liandong.php(原谅我起名字的时候都是很简单的思维)
代码如下 | 复制代码 |
mysql_connect("localhost","root","")or die("链接数据库失败"); ?> |
文章网址:
随意转载^^但请附上教程地址。

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function

WebStorm Mac version
Useful JavaScript development tools

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.

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

Zend Studio 13.0.1
Powerful PHP integrated development environment
