php用文本文件做留言板 在result.php中nickname 改为: $_POST['nickname'];其他也是这样,否则接收不到值的 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 恩,现在register_globals的php的默认设置是off用$_POST 购买虚拟主机送域名 安全稳定!1. 火爆推出:1个国际/国内域名+100M网页空间+企业邮局,惊爆价188元/年。详情登陆网站 http://deidc.com/services/special1. 火惊爆价: 200M网页空间 118元/年。了解详情登陆中频网站 http://deidc.com/Services/Hosting/popularity.aspDNN虚拟主机http://www.deidc.com/Services/Hosting/dnn.aspcoldfusion虚拟主机,支持.CFM 和.CFC,coldfusion7.0http://www.deidc.com/Services/Hosting/coldfusion.aspASP.net2.0虚拟主机,送SQL数据库http://www.deidc.com/Services/Hosting/business.aspFlash Remoting for .NET虚拟主机http://www.deidc.com/Services/Hosting/Flash_Remoting.asp网页制作免费教程站 http://homepage.deidc.com 购买虚拟主机送域名 安全稳定!1. 火爆推出:1个国际/国内域名+100M网页空间+企业邮局,惊爆价188元/年。详情登陆网站 http://deidc.com/services/special1. 火惊爆价: 200M网页空间 118元/年。了解详情登陆中频网站 http://deidc.com/Services/Hosting/popularity.aspDNN虚拟主机http://www.deidc.com/Services/Hosting/dnn.aspcoldfusion虚拟主机,支持.CFM 和.CFC,coldfusion7.0http://www.deidc.com/Services/Hosting/coldfusion.aspASP.net2.0虚拟主机,送SQL数据库http://www.deidc.com/Services/Hosting/business.aspFlash Remoting for .NET虚拟主机http://www.deidc.com/Services/Hosting/Flash_Remoting.asp网页制作免费教程站 http://homepage.deidc.com $nickname 新版的php才支持这种用法 建议用$_POST['nickname'] register_globals就是这个的设置问题,就用$_POST,$_GET,$_SESSION多好的,不用管他的设置了 改了还是不行看看哪有问题,谢谢note.php<html><head><title>小小留言本</title></head><style type="text/css"><!--.{ font-family: "宋体"; font-size: 9pt;color:#000000}--></style><body bgcolor=#cccccc><center><font style=" color=color:#cccccc;font-size:12pt">小小留言本</font></center><form method="POST" action="result.php"><center><table border=0 width=80%><tr><td width=20%>您的大名:</td><td width=80%><input type=text name=nickname style=width:100%></td></tr><tr><td width=20%>电子邮件:</td><td width=80%><input type=text name=email style=width:100%></td></tr><tr><td width=20%>留言:</td><td width=80%><textarea name=note style=width:100%></textarea></td></tr><tr><td width=20%> </td><td width=80% align=center><input type="submit" value="确定"><input type="reset" value="重写"></td></tr></table><hr><?$f = fopen("note.txt","r");$msg = fread($f,filesize("note.txt"));fclose($f);print "$msg";?><p align=right><font style=" color=color:#cccccc;font-size:12pt">作者:<a href="mailto:[email protected]">如冰恋枫</a><br>主页:<a href="http://pollylw.136.tofor.com">如冰恋枫</a></font></center></body> </html>result.php<html><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><title>谢谢留言</title></head><style type="text/css"><!--{font-family:"宋体";font-size:9pt;color:#000000}--></style><body bgcolor=#cccccc><?if ($_POST['nickname']=="") {print "<center><b><font color=#FF99FF>您的大名?</font><br/>";}else if ($_POST['email']=="") {print "<center><b><font color=#FF99FF>您电子邮件?</font><br/>";}else if ($_POST['note']=="") {print "<center><b><font color=#FF99FF>您没有要说的吗?</font><br/>";}else{print "<p></p>";$t = date(Y年m月d日);$_POST['note'] = str_replace ( "<", "<",$_POST['note']); $_POST['note'] = str_replace ( ">", ">", $_POST['note']); $_POST['note'] = str_replace ( "\n", "<br/>", $_POST['note']); $main = "网上大名:<a href=\"mailto:$_POST[['email']\">$_POST['nickname']</a>:($t)<br/>留言: $_POST['note'] <br/><hr>";$f = fopen("note.txt","a");fwrite($f,$main);fclose($f);print "<center><b><font color=#FF99FF>谢谢您的留言!</font><br/>";}?> <p><br/></p> <center><a href="note.php">返回</a></center> <p><br/></p> </center></body></html> 报什么错?在result.php第一行print_r($_POST);看看哪些数据传过来了 http://pollylw.136.tofor.com/note.php先在这输入完成后,点确定后进入http://pollylw.136.tofor.com/result.php页面是白的什么也没有在在result.php第一行加入print_r($_POST);页面是白的什么也没有 $t = date(Y年m月d日);------------有問題,應該是:$t = date('Y年m月d日'); 运行环境兼容问题,以后遇到这种问题先echo 传递的参数,再判断。现在都是用:$_POST[""],$_GET[""],$_SESSION[""]这些接参数了 PHP调用快递API接口报错了 求一个sql语句 sql 问题 帮忙写一段读写文件的代码,谢谢了 怎么判断日期字段是否过期 在页面显示不同内容 PHP新手 高分求购PHP编辑器 请教:ftp_connect怎么总报 函数未定义啊 很奇怪啊 急急急!!!!! 奇怪的问题 PHP能将下拉列表的值赋给数据库中date类型的字段吗 求大神帮忙解释一段php代码,关于crypt加密 php如何设置mysql 语法 错误返回信息 关于MySQL数据库显示乱码的问题
1. 火爆推出:1个国际/国内域名+100M网页空间+企业邮局,惊爆价188元/年。
详情登陆网站 http://deidc.com/services/special1. 火惊爆价: 200M网页空间 118元/年。
了解详情登陆中频网站 http://deidc.com/Services/Hosting/popularity.aspDNN虚拟主机
http://www.deidc.com/Services/Hosting/dnn.aspcoldfusion虚拟主机,支持.CFM 和.CFC,coldfusion7.0
http://www.deidc.com/Services/Hosting/coldfusion.aspASP.net2.0虚拟主机,送SQL数据库
http://www.deidc.com/Services/Hosting/business.aspFlash Remoting for .NET虚拟主机
http://www.deidc.com/Services/Hosting/Flash_Remoting.asp
网页制作免费教程站 http://homepage.deidc.com
1. 火爆推出:1个国际/国内域名+100M网页空间+企业邮局,惊爆价188元/年。
详情登陆网站 http://deidc.com/services/special1. 火惊爆价: 200M网页空间 118元/年。
了解详情登陆中频网站 http://deidc.com/Services/Hosting/popularity.aspDNN虚拟主机
http://www.deidc.com/Services/Hosting/dnn.aspcoldfusion虚拟主机,支持.CFM 和.CFC,coldfusion7.0
http://www.deidc.com/Services/Hosting/coldfusion.aspASP.net2.0虚拟主机,送SQL数据库
http://www.deidc.com/Services/Hosting/business.aspFlash Remoting for .NET虚拟主机
http://www.deidc.com/Services/Hosting/Flash_Remoting.asp
网页制作免费教程站 http://homepage.deidc.com
改了还是不行看看哪有问题,谢谢
note.php
<html>
<head><title>小小留言本</title></head>
<style type="text/css">
<!--
.{ font-family: "宋体"; font-size: 9pt;color:#000000}
-->
</style>
<body bgcolor=#cccccc>
<center><font style=" color=color:#cccccc;font-size:12pt">小小留言本</font></center>
<form method="POST" action="result.php">
<center>
<table border=0 width=80%>
<tr>
<td width=20%>您的大名:
</td>
<td width=80%><input type=text name=nickname style=width:100%>
</td>
</tr>
<tr>
<td width=20%>电子邮件:
</td>
<td width=80%><input type=text name=email style=width:100%>
</td>
</tr>
<tr>
<td width=20%>留言:
</td>
<td width=80%><textarea name=note style=width:100%></textarea>
</td>
</tr>
<tr>
<td width=20%> </td>
<td width=80% align=center><input type="submit" value="确定"><input type="reset" value="重写">
</td>
</tr>
</table>
<hr>
<?
$f = fopen("note.txt","r");
$msg = fread($f,filesize("note.txt"));
fclose($f);
print "$msg";
?>
<p align=right><font style=" color=color:#cccccc;font-size:12pt">作者:<a href="mailto:[email protected]">如冰恋枫</a><br>
主页:<a href="http://pollylw.136.tofor.com">如冰恋枫</a></font>
</center>
</body>
</html>
result.php
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>谢谢留言</title>
</head>
<style type="text/css">
<!--
{font-family:"宋体";font-size:9pt;color:#000000}
-->
</style>
<body bgcolor=#cccccc>
<?
if ($_POST['nickname']=="") {
print "<center><b><font color=#FF99FF>您的大名?</font><br/>";
}
else if ($_POST['email']=="") {
print "<center><b><font color=#FF99FF>您电子邮件?</font><br/>";
}
else if ($_POST['note']=="") {
print "<center><b><font color=#FF99FF>您没有要说的吗?</font><br/>";
}else{
print "<p></p>";
$t = date(Y年m月d日);
$_POST['note'] = str_replace ( "<", "<",$_POST['note']);
$_POST['note'] = str_replace ( ">", ">", $_POST['note']);
$_POST['note'] = str_replace ( "\n", "<br/>", $_POST['note']); $main = "网上大名:<a href=\"mailto:$_POST[['email']\">$_POST['nickname']</a>:($t)<br/>留言: $_POST['note'] <br/><hr>";
$f = fopen("note.txt","a");
fwrite($f,$main);
fclose($f);
print "<center><b><font color=#FF99FF>谢谢您的留言!</font><br/>";
}
?> <p><br/></p>
<center><a href="note.php">返回</a></center>
<p><br/></p>
</center>
</body>
</html>
在result.php第一行print_r($_POST);看看哪些数据传过来了
先在这输入完成后,点确定后进入
http://pollylw.136.tofor.com/result.php
页面是白的什么也没有
在在result.php第一行加入print_r($_POST);页面是白的什么也没有
------------有問題,應該是:
$t = date('Y年m月d日');