![]() |
#2
baixinxing2011-09-15 10:21
|

<?php
/*
主程序实现
*/
include('db.php');
if($_POST['submit']=="输入信息"){
if($_POST['uid']==""||$_POST['regdate']==""||$_POST['remark']==""){
echo "<font color=red>添加失败,请把信息填写完整</font><br>";
}else{
$sql="insert into test2 ('id','uid','regdate','remark') values ('$uid','$regdate','$remark')";
//向数据库发送命令
$result=mysql_query($sql);
echo "<font color=red>记录插入成功</font><br>";
}
}
?>
<html>
<head>
<title>添加注册信息</title>
</head>
<body bgcolor="#fffccc">
</body
<form metchod="post" action="<?php echo $PHP_SELF ?>">
姓名:<input type="text" name="uid" value="<?php echo $uid ?>">
<br>
日期:<input type="text" name="regdate" value="<?php echo $regdate ?>">
<br>
职位:<input type="text" name="remark" value="<?php echo $remark ?>">
</p>
<input type="submit" name="submit" value="输入信息">
</form>
</html>
本人是小菜,不知道自己写这个程序运行不成功!大家帮我看看。 /*
主程序实现
*/
include('db.php');
if($_POST['submit']=="输入信息"){
if($_POST['uid']==""||$_POST['regdate']==""||$_POST['remark']==""){
echo "<font color=red>添加失败,请把信息填写完整</font><br>";
}else{
$sql="insert into test2 ('id','uid','regdate','remark') values ('$uid','$regdate','$remark')";
//向数据库发送命令
$result=mysql_query($sql);
echo "<font color=red>记录插入成功</font><br>";
}
}
?>
<html>
<head>
<title>添加注册信息</title>
</head>
<body bgcolor="#fffccc">
</body
<form metchod="post" action="<?php echo $PHP_SELF ?>">
姓名:<input type="text" name="uid" value="<?php echo $uid ?>">
<br>
日期:<input type="text" name="regdate" value="<?php echo $regdate ?>">
<br>
职位:<input type="text" name="remark" value="<?php echo $remark ?>">
</p>
<input type="submit" name="submit" value="输入信息">
</form>
</html>