php登录表单脚本错误 [英] php login form script error

查看:93
本文介绍了php登录表单脚本错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是php的初学者.我正在按照下面的链接编写用于登录模块的脚本
http://www.phpeasystep.com/phptu/6.html [

I am a beginner in php.I am writing a script for login module following the link below
http://www.phpeasystep.com/phptu/6.html[^]

when i have executed the checklogin.php i got the below error

Notice: Undefined index: myusername in C:\xampp\htdocs\admin\checklogin.php on line 20

Notice: Undefined index: mypassword in C:\xampp\htdocs\admin\checklogin.php on line 21

Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\admin\checklogin.php on line 32
Wrong Username or Password



我已经替换了主机名,用户名,pwd,dbname和表名.代码还有其他需要做的事情吗?

[edit]添加了文本块并单击了链接[/edit]



I have replaced hostname,username,pwd,dbname & table name. Anything else has to be done with code?

[edit]text block added and clickable link[/edit]

推荐答案


要停止
Hi
To stop
Notice: Undefined index: myusername in C:\xampp\htdocs\admin\checklogin.php on line 20<br />
<br />
Notice: Undefined index: mypassword in C:\xampp\htdocs\admin\checklogin.php on line 21

,请不要将变量定义为",在其中放置诸如"test"之类的内容或诸如SHA1校验和之类的长字符串.

至于Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\admin\checklogin.php on line 32,请摆脱count函数,并插入以下代码:

Don''t define the variables as "" put something like "test" or some long string like a SHA1 checksum in there.

As for Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\admin\checklogin.php on line 32 , Get rid of the count function and insert this:


found = false; while (
found=false; while (


db_field = mysql_fetch_assoc(
db_field = mysql_fetch_assoc(


这篇关于php登录表单脚本错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆