Top Comments
All Comments (496)
-
This way has a MASSIVE security risk of SQL injections. Imagine this input for username/password:
'; DROP TABLE users; --
This would fail to log them in BUT delete all users in the table users.
You should add this before running it through the database:
$username = mysql_real_escape_string($user
name); $password = mysql_real_escape_string($pass
word); I know, it's not basic, but one should know dangers of SQL injections. It would also be good to md5 or sha1 all passwords. *complicates everything*
-
why at 5:23 i get this error Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in D:\XAMPP\htdocs\website\login.
php on line 13 That user doesn't exist!
-
i was getting wrong password error, so i started over, and for some reason it work.............started over back from tutorial part 1 and it works,
-
The 1 is not appearing on my screen nothing happened like before
-
@fruitman89 hahahaha i agree
-
hey can you tell me how to transfer data from one page to multiple pages?
ID from page1 to page2 to page3 and goes on........
-
@onebighoe Just install adblock plus.
-
rihanna's ass keeps distracting me!!
-
@onebighoe Learn to bypass, fucking.
I hate youtube ads!!!! im trying to learn :(
onebighoe 2 months ago in playlist More videos from phpacademy 12
This is the full working code for this tutorial. Part I
<?php
$username = $_POST['username'];
$password =$_POST['password'];
if ($username&&$password)
{ $connect = mysql_connect("localhost","root","") or die ("cannot connect to the database"); mysql_select_db("phpalex") or die("Couldn't find db"); $query = mysql_query("SELECT * FROM user1 WHERE username='$username'"); $numrows = mysql_num_rows($query); if ($numrows!=0) {
Exrienz 2 weeks ago 4