我用iis指定了,一个虚拟目录,把php文件放在这个目录中,可以运行php程序,也能从mysql中读取数据在php页面上显示,
是提交form表单时不能接收到任何数据,php.inc 中的 register_globals = off 也改为on了,是什么原因啊。??
是提交form表单时不能接收到任何数据,php.inc 中的 register_globals = off 也改为on了,是什么原因啊。??
调试欢乐多
add.php
##########
<form name="form1" method="post" action="add_ok.php" >
<table>
<tr>
<td width="100%" nowrap>标 题:<input type="text" name="title" size="60" maxlength="80"><br> <textarea name="detail" rows="10" cols="68"></textarea><br>
<input type="submit" name="add" value="提交"> <input type="reset" value="重填"> <input type="button" value="返回" onClick="history.back()"></td>
</tr>
</table>###############
add_ok.php
################
<?php
if ($add){ $title=htmlspecialchars($title);
$detail=htmlspecialchars($detail);
echo "$title";
echo "$detail";
}
?>###########################
没有任何结果输出。空白啊。??为什么啊。??</form>
在add.php 尾部的呵
但关键问题是,用POST方式传过来数据都存在$_POST全局数组里,
所以要读到数据必须通过这种方式:$_POST["add"]
调试程序如下:通过!################
add.php
##########
<form name="form1" method="post" action="add_ok.php" >
<table>
<tr>
<td width="100%" nowrap>标 题:<input type="text" name="title" size="60" maxlength="80"><br> <textarea name="detail" rows="10" cols="68"></textarea><br>
<input type="submit" name="add" value="提交"> <input type="reset" value="重填"> <input type="button" value="返回" onClick="history.back()"></td>
</tr>
</table></form>###############
add_ok.php
################
<?php$add=$_POST["add"];if ($add){ $title=htmlspecialchars($_POST["title"]);
$detail=htmlspecialchars($_POST["detail"]);
echo "$title";
echo "<p>";
echo "$detail";
}
?>
进pnp.inc
把register_globals 改为on