I keep Getting this error. Does anyone know what is wrong? The error message points to the second page after I click edit on the first page.
Thanks!
Notice: Undefined variable: Email in E:\Accounts\sunsetli\displayform.php on line 16
Here is the code
------------First Page(db_browser3.php)------------------
<html>
<head>
<title>Maildata record browser</title>
</head>
<body bgcolor="#FFFFFF" text="#000000">
<?php
$connect= mysql_connect("localhost","***","**")
or die("Could not connect to MySQL server in localhost !");
$selectdb=mysql_select_db("sunsetli_sunset")
or die("Could not select sunsetli_sunset database !");
$sqlquery = "SELECT * from Maildata";
$queryresult = mysql_query($sqlquery);
echo "<table width=700 border=1 align=center>";
echo " <tr>";
echo " <td width=200> <center><b>Name </b></center></td>\n";
echo " <td width=200> <center><b>E-mail</b></center></td>\n";
echo " <td width=200> <center><b>Secondary e-mail</b></center></td>\n";
echo " <td width=100> <center><b>Action</b></center></td>\n";
echo " </tr>\n";
while ($row=mysql_fetch_array($queryresult))
{
echo " <tr>\n";
echo " <td>".$row["Name"]."</td>\n";
echo " <td>".$row["Email"]."</td>\n";
echo " <td>".$row["Secondaryemail"]."</td>\n";
echo " <td><A href=\"displayform.php?email=".$row["Email"]."\">edit</a></td>\n";
echo " </tr>\n";
}
echo "</table>\n";
?>
</body>
</html>
-----------------Second Page (displayform.php)--------------
<html>
<head>
<title>Mail record update form</title>
</head>
<body bgcolor="#FFFFFF" text="#000000">
<form name="maildata" method="post" action="changes.php">
<table width="250" border="1" align="center">
<?php
$connect= mysql_connect("localhost","*****","*****")
or die("Could not connect to MySQL server in localhost !");
$result=mysql_select_db("sunsetli_sunset")
or die("Could not select sunsetli_sunset Database");
$sqlquery = "SELECT * from Maildata where Email='".$Email."'";
$queryresult = mysql_query($sqlquery);
if($row=mysql_fetch_array($queryresult))
{
echo "<tr> ";
echo " <td> Name </td>";
echo " <td width=\"150\"> ". $row["Name"] . " </td>";
echo "</tr>";
echo "<tr> ";
echo " <td> e-mail </td>";
echo " <td>". $row["Email"]."</td>";
echo " <td> <input type=\"hidden\" Name=\"Email\"
value=\"".$row["Secondaryemail"]."\" ></td>";
echo "</tr>";
echo " <tr> ";
echo " <td> secondary e-mail </td>";
echo " <td> ";
echo " <input type=\"text\" Name=\"Secondaryemail\"
value=\"".$row["Secondaryemail"]."\" >";
echo " </td>";
echo "</tr>";
echo "<tr> ";
echo " <td> ";
echo " <center> ";
echo " <input type=\"submit\" name=\"Submit\"
value=\"Submit\">";
echo " </center>";
echo " </td>";
echo "</tr>";
}
?>
</table>
</form>
</body>
</html>