上面的程序是被post调用,如果你们看着没有问题就说个“没问题”
让我再去别的地方找原因

解决方案 »

  1.   

    上面的程序是被post调用--------------------php4以上接受post数据使用$_POST['yours']这样的格式,
    接收session数据使用$_SESSION['yours']这样的格式,楼主上面的都错了.另,楼主用的是PHP4还是几?现在网上和书上许多教程都是有问题的.\
    建议下个PHP手册好好看看.
      

  2.   

    好像是没什么错,是不是账号密码不正确执行了$message啊,那也要echo $message;啊
    要不把if ($account and $password)该成 if (isset($account and $password))
      

  3.   

    我用的是php4,密码不正确时也没什么反应,根本没有执行$message,
    页面只是刷新一下就又回到了最初。
      

  4.   

    lzkd(浪子快刀) 已经解答了你的问题,你的POST和SESSION变量的调用方式都不对,你怎么还不信呢?还要坚持使用$message?
      

  5.   

    <?
    session_start();
    $account=$_POST['account'];
    $password=$_POST['password'];
    /////////////////
    改了以后还是不执行啊,
      

  6.   

    <?
    session_start();
    $account=$_POST['account'];
    $password=$_POST['password'];
    echo $account;
    echo $password;
    看看有没有输出
    那个sql语句后面不用加分号
      

  7.   

    不行啊,没有反应。
    我的电脑好像不会传变量了,是不是我的php出问题了?
      

  8.   

    <?
    session_start();
    $account=$_POST['account'];
    $password=$_POST['password'];
    echo $account;
    echo $password;
    ?>
    只要这段代码看看
    那些名字没有错吧
      

  9.   

    出现了这个错误
    Warning: Cannot modify header information - headers already sent by (output started at C:\Sunlinks\Web\www\ehuade\tryregister.php:5) in C:\Sunlinks\Web\www\ehuade\tryregister.php on line 38
    我的程序是
    <?
    session_start();
    $account=$_POST['account'];
    $password=$_POST['password'];
    echo $account;//可以显示
    echo $password;;//可以显示echo "<br>";
    if ($account and $password)
    {
    echo $account;;//可以显示echo "<br>";
      $link_ID=mysql_connect("localhost","root","123");
       mysql_select_db("ehuade");
       $str="SELECT * FROM huadeuser WHERE username='$account' and userpassword='$password'";
       $result=mysql_query($str,$link_ID);
       $row=mysql_num_rows($result);
       if(!$row or $row==0)
             { $message="您输入的帐号、密码不正确,请重新输入";}
       else {
            $arra=mysql_fetch_row($result);  
             session_register("CID");
              $_SESSION['CID']=$arra[1];
       $CID=$_SESSION['CID'];
       echo $CID;        //可以显示          session_register("userpower");
              $_SESSION['userpower']=$arra[6];
      $userpower=$_SESSION['userpower'];
              session_register("userunit");
              $_SESSION['userunit']=$arra[4];
      $userunit=$_SESSION['userunit'];
              session_register("usertel");
              $_SESSION['usertel']=$arra[5];
       session_register("uname");
              $_SESSION['umame']=$arra[3];
     

        Header("Location:http://192.168.0.211/ehuade/inde.php");//第38行,为什么这里出错了?
    exit();
         };
    }
    ?>
      

  10.   

    嗯....你把
    echo $account;//可以显示
    echo $password;;//可以显示这样的去掉,就可以了.---要所有输出的部分哦.
    header函数前面不可以有输出的.
      

  11.   

    可以可以了,先谢谢uuq(杜牧), lzkd(浪子快刀)
      

  12.   

    接上面的Header("Location:http://192.168.0.211/ehuade/inde.php")转到的页面;
    再请教一个关于session传递变量的问题。
    http://192.168.0.211/ehuade/inde.php的内容为
    <?
    session_start();if(empty($_SESSION['CID']))     //为什么这里接不到上页的值,
     echo "不没传递!";           //输出显示,     
    ?>
      

  13.   

    我的php.ini 
    register_globals = on
      

  14.   

    <?
    session_start();echo($_SESSION['CID']);
    ?>先试一下