Problems with login PHP script
Posted: Fri Mar 23, 2012 7:01 am
Hello everyone 
I am new to the forums, and it's nice to see that so many people are helping eachother!
I was following a guide on YouTube today, on how to create a login script in PHP, i have a problem tho.
I followed this guide -> http://www.youtube.com/watch?v=4oSCuEtxRK8
And i did EXACTLY everything he did, but...
At the end of his video, he logged in, and got a blank screen, which means he logged succesfully in, but all i get is this:
Notice: Undefined variable: username in C:\xampp\htdocs\xampp\Lowchat\login.php on line 6
And my script looks like this:
<?php
$usname = $_POST ['username'];
$password = $_POST['password'];
if ($username&&$password) - THIS IS LINE 6
{
$connect = mysql_connect("localhost","root","lol123","") or die("I could not connect to the MYSQL database!");
mysql_select_db('phplogin') or die("Could not find the database");
}
else
die();
?>
What is wrong with my script here :-S?
I am new to the forums, and it's nice to see that so many people are helping eachother!
I was following a guide on YouTube today, on how to create a login script in PHP, i have a problem tho.
I followed this guide -> http://www.youtube.com/watch?v=4oSCuEtxRK8
And i did EXACTLY everything he did, but...
At the end of his video, he logged in, and got a blank screen, which means he logged succesfully in, but all i get is this:
Notice: Undefined variable: username in C:\xampp\htdocs\xampp\Lowchat\login.php on line 6
And my script looks like this:
<?php
$usname = $_POST ['username'];
$password = $_POST['password'];
if ($username&&$password) - THIS IS LINE 6
{
$connect = mysql_connect("localhost","root","lol123","") or die("I could not connect to the MYSQL database!");
mysql_select_db('phplogin') or die("Could not find the database");
}
else
die();
?>
What is wrong with my script here :-S?