为什么我的老是报错误

红色银狐 2004-12-21 02:02:53
<?php
//print($HTTP_POST_VARS['submit']);
$submit = $_POST['submit'];
if($submit != "")
{
echo "Value";
}
?>
<html>
<head>
<title>添加管理员</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="../../main.css" type="text/css">
</head>
<body bgcolor="#9CC7EF" text="#000000" topmargin="100" leftmargin="0" rightmargin="0" bottommargin="0">
<form method="post" action="useradd.asp?action=save" name="form1">
<table width="60%" border="1" bordercolordark=#9CC7EF bordercolorlight=#145AA0 cellspacing="0" cellpadding="4" align="center">
<tr bgcolor="#4296E7">
<td colspan="2"><div align="center"><font color="#FFFFFF">添加管理员</font></div></td>
</tr>
<tr>
<td width="41%" nowrap><div align="right">管理员帐号</div></td>
<td width="59%"><input type="text" name="userID" size="10"></td>
</tr>
<tr>
<td width="41%" nowrap height="25"><div align="right">管理员密码</div></td>
<td width="59%" height="25"><input type="password" name="password1" size="10"></td>
</tr>
<tr>
<td width="41%" nowrap height="25"><div align="right">再输入密码</div></td>
<td width="59%" height="25"><input type="password" name="password2" size="10"></td>
</tr>
<tr>
<td colspan="2" align="center">
<input name="submit" type="submit" id="submit" value="添加">
<input type="reset" name="reset" value="重置">
<input type="button" name="button" value="刷新" onClick="javascript:window.location.reload();" style="cursor: hand">
</td>
</tr>
<tr bgcolor="#4296E7">
<td colspan="2"></td>
</tr>
</table>
</form>
</body>
</html>

为什么我的老是报
Notice: Undefined index: submit in d:\usr\www\html\php\admin\system\useradd.php on line 3
...全文
104 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
红色银狐 2004-12-21
  • 打赏
  • 举报
回复
不错!
谢谢
Cain 2004-12-21
  • 打赏
  • 举报
回复
晕,被老大抢先一小步-_-!
Cain 2004-12-21
  • 打赏
  • 举报
回复
<?php
//print($HTTP_POST_VARS['submit']);
if ($_SERVER[REQUEST_METHOD]=='POST') {
$submit = $_POST['submit'];
if($submit != "")
{
echo "Value";
}
}
?>
xuzuning 2004-12-21
  • 打赏
  • 举报
回复
<?php
//print($HTTP_POST_VARS['submit']);
$submit = $_POST['submit'];
if($submit != "")
{
echo "Value";
}
?>
===>
<?php
if($_SERVER['REQUEST_METHOD'] == "POST") {
$submit = $_POST['submit'];
if($submit != "")
{
echo "Value";
}
}
?>
tt007 2004-12-21
  • 打赏
  • 举报
回复
传递按钮的值,没用过啊,为什么要传递按钮的值呢,奇怪!!!

21,886

社区成员

发帖
与我相关
我的任务
社区描述
从PHP安装配置,PHP入门,PHP基础到PHP应用
社区管理员
  • 基础编程社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧