Lol you did way too much work. Just take away the while loop and when you make the $password variable at the very top, encrypt it to md5 there and then check the passwords in the MySQL query.
the way you check the password is very dangerous anyway. if you use sqlinjection on the username so you get all the table as result, you could try the password with every table's tuples!. username is unique, so why why the "while loop" and not just an if statement?
can someone help me with this coding? it gives me an Parse error: syntax error, unexpected T_ELSE on line 40 the coding is if ($loggedin == TRUE) { if ($rememberme=="on") setcookie("username", $username, time()+7200); else if ($rememberme == "") $_SESSION['username']='$username'; { header("Location:welcome.php"); exit() else header("Location incorrect.php") } }
HI mate , thank you , I am a novice php programmer , and this trick of sql injection I didn't know ,
A lot of webpage that I've seen , shows the script '$username' AND '$password' , witch is vulnerable. So , I think we must take care about the examples of codes over the internet , many of them can be vulnerable.
Lol you did way too much work. Just take away the while loop and when you make the $password variable at the very top, encrypt it to md5 there and then check the passwords in the MySQL query.
baseball4355 5 days ago
the way you check the password is very dangerous anyway. if you use sqlinjection on the username so you get all the table as result, you could try the password with every table's tuples!. username is unique, so why why the "while loop" and not just an if statement?
gerrodrigu 1 week ago
can someone help me with this coding? it gives me an Parse error: syntax error, unexpected T_ELSE on line 40 the coding is if ($loggedin == TRUE) { if ($rememberme=="on") setcookie("username", $username, time()+7200); else if ($rememberme == "") $_SESSION['username']='$username'; { header("Location:welcome.php"); exit() else header("Location incorrect.php") } }
EverydayTechable 3 months ago
why did you not use mysql_num_rows instead of while then loop the data then execute a statement???hehhe just asking :)
Panthom09 6 months ago
php academy thanks for all that you do for us , i think that you should team up with phpclass , many thanks
From Brazil
(P.S. I Think You Should Really Consider It)
rexonom1 6 months ago
HI mate , thank you , I am a novice php programmer , and this trick of sql injection I didn't know ,
A lot of webpage that I've seen , shows the script '$username' AND '$password' , witch is vulnerable. So , I think we must take care about the examples of codes over the internet , many of them can be vulnerable.
Many thanks from Brazil
apagao666 7 months ago
Comment removed
ShAh3ryar 8 months ago
I keep getting:
Notice: Undefined variable: username in = index p h p on line 19
Which is basicly:
($username&&$password)
Jagatia 9 months ago
@Jagatia i do all right but still there is inocorrect password combination error :@
ShAh3ryar 8 months ago
Alex U r gre88888888 thanks for posting
mahipal6535 1 year ago
This has been flagged as spam show
@mahipal6535 MY page is given incorrect password even i write the right one
ShAh3ryar 8 months ago
This has been flagged as spam show
the teacher said it was kinda hard ;) but its kinda fun tho:)
MrOkmasterify 1 year ago
nice im going to learn this soon on school.. ;D
MrOkmasterify 1 year ago
nice one
rluximon 1 year ago
This has been flagged as spam show
@rluximon MY page is given incorrect password even i write the right one
ShAh3ryar 8 months ago
thanks for these great tutorials
lucky0926 2 years ago
Nice tut Alex!
many thanks!
omanoman98 2 years ago
You're 100% welcome!
phpacademy 2 years ago
@phpacademy MY page is given incorrect password even i write the right one
ShAh3ryar 8 months ago
@phpacademy please help me buddy
ShAh3ryar 8 months ago
@omanoman98 MY page is given incorrect password even i write the right one
ShAh3ryar 8 months ago