免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1745 | 回复: 3

MYSQL与PHP问题,急急!!!!! [复制链接]

论坛徽章:
0
发表于 2003-06-17 10:10 |显示全部楼层
我在LINUX9.0装好apache1.3.27、mysql4.0.13、PHP4.3.0,一切都运行正常,我用mysql作用户访问www的认证,编了一个PHP文件,可不起作用,各位大虾看看吧!!!!!!!!!!!
我的index.html:
<html>;
<head>;
<meta http-equiv=Content-Type content=\"text/html; charset=gb2312\">;
<body bgcolor=#D3DCE3>;
<hr>;
<br>;

<form method="OST" action="result.php">;
<center>;
Username: <input type=text name=id maxlength=32>;<br>;<br>;
Password: <input type=password name=passwd maxlength=32>;<br>;<br>;

<input type="submit" value="提交">;
<input type="reset" value="重写">;
</form>;
<hr>;
<p>;Email: <a href="mailto:kegan.hong@srit.com.cn">;administrator</a>;<br>;
</center>;
</form>;
</body>;
</html>;
我的PHP文件result.php:
<?php
define(HOST,"idc_test";
define(USER,"root";
define(PASS,"srit12345";
define(DB_NAME, "srit";

mysql_connect(HOST,USER,PASS);
mysql_select_db(DB_NAME);

$r = mysql_query("select * from mrtg WHERE name='$id' and password='$passwd'";

if ( mysql_num_rows($r) >; 0 ){
$query = mysql_fetch_array($r);
readfile ("/home/traffic/".$query["url"]);
}
else{
echo "<html>;";
echo "<head>;";
echo "<meta http-equiv=Content-Type content=\"text/html; charset=gb2312\">;";
echo "<body bgcolor=#D3DCE3>;";
echo "<hr>;<br>;";
echo "<center>;";
echo "username or password is wrong , plese try again";
echo "<p>;";
echo "<a href=\"index.html\">;retrun</a>;";
echo "<p>;<hr>;<p>;Email:<a href=\"mailto:kegan.hong@srit.com.cn\">;Administrator</a>;";
echo "</center>;";
echo "</form>;";
echo "</body>;";
echo "</html>;";
}

mysql_free_result($r);
mysql_close();
?>;

我在IE上输入在MYSQL表里建立的用户名和密码,总是报:
username or password is wrong , plese try again

论坛徽章:
0
发表于 2003-06-17 10:14 |显示全部楼层

MYSQL与PHP问题,急急!!!!!

论坛徽章:
0
发表于 2003-06-17 10:19 |显示全部楼层

MYSQL与PHP问题,急急!!!!!

idc_test这台机器是你的服务器吗?和APACHE是在一起的吗?

论坛徽章:
0
发表于 2003-06-17 13:53 |显示全部楼层

MYSQL与PHP问题,急急!!!!!

取参有问题吧,php4。3的取参方式好像变了
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP