<?php
require_once("Actions/config.php");
if(isset($_POST['email_address']) && $_POST['password']){
$sql = "SELECT * FROM $tbl_name WHERE email_address ='$email_address' and password ='$password'";
$result = @mysql_query($sql);
// Mysql_num_row is counting table row
$count = @mysql_num_rows($result);
// If result matched $myusername and $mypassword, table row must be 1 row
if($count==1){
// Register $myusername, $mypassword and redirect to file "login_success.php"
session_register("email");
session_register("password");
header("Location: http://localhost/Actions/home.php");
}
else
{
echo "Wrong Username or Password";
}
}
?>
I get a undefined varible to email_address on line 5
this varible is declared in the form which is on index.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>YourRoom-Social Networking Engine</title>
</head>
<body>
<table width="300" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
<tr>
<form name="form1" method="post" action="login.php">
<td>
<table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF">
<tr>
<td colspan="3"><strong>Member Login </strong></td>
</tr>
<tr>
<td width="78">Email</td>
<td width="6">:</td>
<td width="294"><input name="email_address" type="text" id="email_address"></td>
</tr>
<tr>
<td>Password</td>
<td>:</td>
<td><input name="password" type="text" id="password"></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td><input type="submit" name="submit" value="submit"></td>
</tr>
</table>
</td>
</form>
</tr>
</table>
</body>
</html>
Any ideas why I keep on getting this?