login page php
Posted: Thu Apr 12, 2012 8:33 am
I am currently trying to make a log in page for my website i am following this tutorial on youtube http://www.youtube.com/watch?v=4oSCuEtxRK8
however i currently have a problem
<form method="POST" action='login.php'>
Username<input type='text' name='username'></br>
Password<input type='password' name='password'></br>
<input type='submit' value='Log in'>
</form>
and my login page code atm is
<?php
$username = $_ POST('username');
$password = $_ POST('password');
if ($username&&$password)
{
$connect = mysql_connect("localhost","root","")or die ("couldn't connect");
mysql_select_db("mylogin") or die ("could not find the database");
else die("please enter a username and password");
}
?>
it says that i have got a promeblem at line 3 in my login page which satrts $username it gives me a T_string error saying that it does not recognise username or password.
however i currently have a problem
<form method="POST" action='login.php'>
Username<input type='text' name='username'></br>
Password<input type='password' name='password'></br>
<input type='submit' value='Log in'>
</form>
and my login page code atm is
<?php
$username = $_ POST('username');
$password = $_ POST('password');
if ($username&&$password)
{
$connect = mysql_connect("localhost","root","")or die ("couldn't connect");
mysql_select_db("mylogin") or die ("could not find the database");
else die("please enter a username and password");
}
?>
it says that i have got a promeblem at line 3 in my login page which satrts $username it gives me a T_string error saying that it does not recognise username or password.