This is the first page of my website(AssociationAdd.php). When I clicked the 'Add' button, it shows that :
"Notice: Undefined index: T2 in c:\easyphp1-8\www\efiling\associationaddprocess.php on line 19
Notice: Undefined index: T1 in c:\easyphp1-8\www\efiling\associationaddprocess.php on line 20"
<html>
<head>
<meta http-equiv="Content-Language" content="ja">
<title>Index</title>
</head>
<div style="position: absolute; width: 1146px; height: 842px; z-index: 1; left:10px; top:1px" id="layer2" align="center">
<body background="E-Filing%20Management%20System%20Picture/Snow.gif">
<p align="center">
<img border="0" src="E-Filing%20Management%20System%20Picture/logo-RR-gif.gif" width="957" height="245"></p>
<p align="center"><span lang="zh-cn"> </span></p>
<p align="center"><span lang="zh-cn"><img border="0" src="E-Filing%20Management%20System%20Picture/Association.gif" width="491" height="74"></span></p>
<p align="center"><span lang="zh-cn"> </span></p>
<div style="position: absolute; width: 191px; height: 28px; z-index: 2; left: 546px; top: 441px" id="layer4">
<font color="#FFFFFF"><span lang="en-us">
<font size="4" face="Arial Rounded MT Bold"> Association Name</font></span></font></div>
<div style="position: absolute; width: 70px; height: 24px; z-index: 1; left: 298px; top: 442px" id="layer3">
<font size="4" face="Arial Rounded MT Bold"><font color="#FFFFFF"><span lang="en-us">
Index</span></font></font></div>
<p align="center"><span lang="zh-cn">
</span><font color="#FFFFFF"><span lang="en-us">
<font face="Arial Rounded MT Bold"> </font>
<font size="4" face="Arial Rounded MT Bold"> </font></span></font></p>
<p align="center"><span lang="en-us"> </span>
<?php
echo"<form method='POST' action='AssociationAdd.php'>";
echo"<input type='text' name='T2' size='11'> ";
echo"<input type='text' name='T1' size='77'></p>";
echo"<p> <input type='submit' value=' Add ' name='submit' style='font-family: Times New Roman; color: #000000; font-weight: bold; font-size: 12pt'> ";
echo"<input type='reset' value=' Reset ' name='B2' style='font-family: Times New Roman; color: #000000; font-weight: bold; font-size: 12pt'> ";
echo"<input type='submit' value=' Back ' name='submit' style='font-family: Times New Roman; color: #000000; font-weight: bold; font-size: 12pt'></p>";
if(isset($_POST["submit"]))
{
$submit = $_POST["submit"];
$T1 = $_POST["T1"];
$T2= $_POST["T2"];
if($submit==" Add ")
{
print "<script language ='javascript'>window.location.href='AssociationAddProcess.php?T1=$T1&T2=$T2'</script>";
}
else if($submit==" Back ")
{
print "<script language ='javascript'>window.location.href='Association.php'</script>";
}
}
echo"</form>";
?>
</div>
</body>
</html>
This is the second page(AssociationAddProcess.php):
<html>
<head>
<meta http-equiv="Content-Language" content="ja">
<title>Index</title>
</head>
<body background="E-Filing%20Management%20System%20Picture/Snow.gif">
<p align="center">
<img border="0" src="E-Filing%20Management%20System%20Picture/logo-RR-gif.gif" width="957" height="245"></p>
<p align="center"><span lang="zh-cn"> </span></p>
<p align="center"><span lang="zh-cn"><img border="0" src="E-Filing%20Management%20System%20Picture/Association.gif" width="491" height="74"></span></p>
<?php
$id = $_POST["T2"];
$an = $_POST["T1"];
if ($id==null||$an==null)
{
print"
<p align='center'> </p>
<table width='400' height='200' border='1' align='center' bordercolor='#66FF00'bgcolor='#0000FF'>
<td><div align='center'><font color='#FF0000' size='5'><p>Please Enter Index and Association Name Completely</p> </font></div></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table> ";
print "<p align='center'> </p>";
echo "<HTML><META HTTP-EQUIV='REFRESH' CONTENT='2; URL=AssociationAdd.php'>
<CENTER><p> </p><p>
<tr>
<td align='center'><h12>please wait...</h12></td>
</tr>
</table><p> </p><p> </p></CENTER></BODY></HTML>";
}
else
{
$connection=mysql_connect("localhost","root","")
or die("<font color='#FFFFFF'>Could not connect to MySQL</font>".mysql_error());
$selection=mysql_select_db("efiling")
or die("<font color='#FFFFFF'>Unable to select database.</font>".mysql_error());
$sql2 = "SELECT * from association Where AssociationName='$an'";
$result2 = mysql_query($sql2)
or die("<font color='#FFFFFF'>SQL select statement failed</font>");
if (mysql_num_rows($result2) < 1)
{
$sql = "INSERT INTO association(Index, AssociationName) VALUES ('$id', '$an')";
$result=mysql_query($sql)
or die("<font color='#FFFFFF'>SQL select statement failed</font>");
if ($result)
{
print "<script language ='javascript'>window.alert('Added Succesfully!');window.location.href='AssociationAdd.php'</script>";
}
else
{
die(mysql_error());
}
}
else
{
print"<p align='center'> </p>
<table width='400' height='200' border='1' align='center' bordercolor='#66FF00'bgcolor='#0000FF'>
<td><div align='center'><font color='#FF0000' size='5'><p>The Association Name Has Been Registered, Please Enter Other Association Name</p> </font></div></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table> ";
print "<p align='center'> </p>";
echo "<HTML><META HTTP-EQUIV='REFRESH' CONTENT='2; URL=AssociationAdd.php'>
<CENTER><p> </p><p>
<tr>
<td align='center'><h12>please wait...</h12></td>
</tr>
</table><p> </p><p> </p></CENTER></BODY></HTML>";
}
}
?>
</body>
</html>
Anyone can tell me what is the problem and how to solve it?