由 shineway 在 06-02-2004 18:43 发表:
数据库插入问题!帮帮忙!
我做了三页
第一页:pre_inc.php
代码为:
1<html>
2<head>
3<meta content="text/html; charset=utf-8" http-equiv="Content-Type"/>
4<title>无标题文档</title>
5</head>
6<body>
7</body>
8<p><font color="#33CC66" size="+3">shineway地址薄</font></p>
9
$username='root';
$passwd='';
$db_name='baby_db';
$table_name='address';
$link_message=@mysql_connect('localhost:3306',$username,$passwd);
if (!$link_message) {
echo "对不起,数据库连接错误!";
exit();
}
1
2</html>
第二页:add_from.php
代码为:
1<html>
2<body>
3<div align="center">
4
require('pre_inc.php');
1
2<form action="add_action.php" method="post" name="form1">
3<p>插入内容</p>
4<p>姓名:
5
6<input name="name" type="text"/>
7</p>
8<p><span class="style1">地址:</span> <input name="address" type="text"/>
9</p>
10<p c="">电话:
11
12<input name="tel" type="text"/>
13</p>
14<p class="style1">生日:
15
16<input name="bir" type="text"/>
17</p>
18<p class="style1">最近会面日期:
19
20<input name="recent_date" type="text"/>
21</p>
22<p class="style1">说明:
23
24<textarea name="more"></textarea>
25</p>
26<p>
27<input name="Submit" type="submit" value="提交"/>
28<input name="Submit2" type="reset" value="重置"/>
29</p>
30</form></div>
31
32</body>
33</html>
第三页:add_action.php
代码为:
数据库插入失败 '; echo " ``` 请点击这里返回重新插入! ``` "; }else&