MYSQL与PHP问题,急急!!!!!
我在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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
idc_test这台机器是你的服务器吗?和APACHE是在一起的吗?
取参有问题吧,php4。3的取参方式好像变了