麻烦帮忙看看下面的呆吗?谢谢 中间转到了student_chat.php页面,将student_chat.php页面的代码帖出来 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 student_chat.php on line 15是student_chat.php的15行 不好意思铁错了<?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";注释掉了为什么还可以创建数据库成功阿 还有这个地方为什么跳不过去啊?<?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);//结束?> if($row==1)$row会得一吗?他好象是一个数组吧.你变成if($row) $link=mysql_connect($host,$name,$password) ;就已经连接数据库了,$host如果为空则默认为localhost,加上你的mysql允许本地匿名连接,所以仍然正常连接数据库header前面在默认缓存方式下不能有输出 请教一个服务配置方法 新手的一个简单问题,在单页内传值。 如何更改XML的编码啊 怎么登录用http头的401 Unauthorized进行身份验证的服务器? 大家帮忙分析一下代码,关于录制视频截图的 一条SQL语句,在线等 file_get_contents 打开URL后不是相应的列表页,而是首页 在PHP中从mysql取得的字符写到EXCEL中是乱码! 哪位能给稍微介绍一下session…… 为什么我的php文件生成的验证码图片在浏览器不显示 为什么图片不能显示 请教PHP的GET传值问题!
是student_chat.php的15行
铁错了
<?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";注释掉了为什么还可以创建数据库成功阿
为什么跳不过去啊?<?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);
//结束?>
$row会得一吗?他好象是一个数组吧.你变成if($row)
就已经连接数据库了,$host如果为空则默认为localhost,加上你的mysql允许本地匿名连接,所以仍然正常连接数据库
header前面在默认缓存方式下不能有输出