Hi,
I have a file called index.php which includes login.php and functions.php. My idea is that the page will be posting to it's self but I am having trouble getting my login system to work. Here's my code for my 3 files.
functions.php
<?php
$loggedIn=false;
function logIn($username,$password)
{
$sql="SELECT * FROM $tbl_name WHERE username='$username' and password='$password'";
$result=mysql_query($sql);
$count=mysql_num_rows($result);
if($count==1)
{
$loggedIn=true;
}
else
{
echo "Wrong Username or Password";
}
}
?>
login.php
<HTML>
<HEAD>
<TITLE>Login</TITLE>
</HEAD>
</HTML>
<FORM ACTION="index.php" METHOD="POST">Username
<INPUT TYPE="text" name="Username">Password
<INPUT TYPE="password" name="Password">
<INPUT TYPE=SUBMIT VALUE="submit">
</FORM>
</HTML>
Part of the index.php where the error is occuring:
include('functions.php');
if ((isset($_GET('$username'))&&(isset($_GET('$password')))))
{
logIn($username,$password);
}
Can anyone see what the problem is?
Cheers,