中间转到了student_chat.php页面,将student_chat.php页面的代码帖出来

解决方案 »

  1.   

    student_chat.php on line 15
    是student_chat.php的15行
      

  2.   

    不好意思
    铁错了
    <?php
            //#include "connect.inc";        $link=mysql_connect($host,$name,$password) ;
           
       $ok=mysql_create_db("huzhangyou");
      
       if($ok)
       {
       echo "ok!";
       }
       else
       {
       echo "no!";
       }
           mysql_close($link);
       ?>我把#include "connect.inc";注释掉了为什么还可以创建数据库成功阿
      

  3.   

    还有这个地方
    为什么跳不过去啊?<?php
    //连数据库  #include "connect.inc";//判断数据库中是否已经由此人
    //如果有,判断密码是否正确
    //如果不正确,返回index.html
    //如果正确,进入
      $Connid=@mysql_connect($host,$name,$password) or exit();
      @mysql_select_db("user") or exit();
      $today=date("Y-m-d H:i:s");
      $query="select tpassword from teachertable where tname='$tname'";
      //$result=mysql_db_query("user",$query);
      $result=@mysql_query($query) or die("查询错误!");  $row=mysql_fetch_array($result);
         if($row==1)
          {
            $fpasswd=$row["tpassword"];
            if($pass!=$fpasswd)
              {
               echo"你输入的密码或用户名不对!请正确输入";
               echo"<a href=\"index.html\">返回</a>";
               //header("location:index.html");
              }
            else
              {
               $num=$row["login_num"];
               $num++;
               $tid=$row["tid"];
               $query1="update studenttable set status='on',login_num='$num',last_login='$today' where uid='$uid'";
               $result1=mysql_query($query1) or die("设定错误!");
               header("location:teacher_chat.php?tid=$tid&tname=$tname");
              }
            }  
     /* 
        $num=mysql_num_rows($result);
        if($num==0)
         {
          echo "没有此人!";
         }
        else
         {  
          $fpasswd=mysql_result($result,0,"tpassword");
          if($pass!=$fpasswd)
             {
              // echo"你输入的密码不对!请正确输入";
               header("location:index.html");
             }
          else
             {
               header("location:teacher_chat.php?uid");
             }
          }
        
    */  mysql_close($Connid);
    //结束?>
      

  4.   

    if($row==1)
    $row会得一吗?他好象是一个数组吧.你变成if($row)
      

  5.   

    $link=mysql_connect($host,$name,$password) ;
    就已经连接数据库了,$host如果为空则默认为localhost,加上你的mysql允许本地匿名连接,所以仍然正常连接数据库
    header前面在默认缓存方式下不能有输出