在result.php中
nickname 改为: $_POST['nickname'];其他也是这样,否则接收不到值的

解决方案 »

  1.   

    恩,现在register_globals的php的默认设置是off用$_POST
      

  2.   

    购买虚拟主机送域名 安全稳定!
    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
      

  3.   

    购买虚拟主机送域名 安全稳定!
    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
      

  4.   

    $nickname 新版的php才支持这种用法  建议用$_POST['nickname']
      

  5.   

    register_globals就是这个的设置问题,就用$_POST,$_GET,$_SESSION多好的,不用管他的设置了
      

  6.   


    改了还是不行看看哪有问题,谢谢
    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>
      

  7.   

    报什么错?
    在result.php第一行print_r($_POST);看看哪些数据传过来了
      

  8.   

    http://pollylw.136.tofor.com/note.php
    先在这输入完成后,点确定后进入
    http://pollylw.136.tofor.com/result.php
    页面是白的什么也没有
    在在result.php第一行加入print_r($_POST);页面是白的什么也没有
      

  9.   

    $t = date(Y年m月d日);
    ------------有問題,應該是:
    $t = date('Y年m月d日');
      

  10.   

    运行环境兼容问题,以后遇到这种问题先echo 传递的参数,再判断。现在都是用:$_POST[""],$_GET[""],$_SESSION[""]这些接参数了