I can now get the form to validate with the message 'this user already exits!!!' If there is a record to find.
what I want to do is jump to gettd.php to then display the record but using '<meta http-equiv="refresh" content="0;url=gettd.php">'; just clears the record so gettd.php displays an empty record.
here is gettd.php
<?
include("dbinfo.inc.php");
$last=$_GET['surname'];
$first=$_GET['firstname'];
$sex=$_GET['male_female'];
$dob=$_GET['dob'];
$id=$_GET['id'];
$date=$_GET['datesubmitted'];
mysql_connect($host,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query="SELECT * FROM sand WHERE surname='$last' and firstname='$first' and male_female='$sex' and dob='$dob'";
$result=mysql_query($query);
$num=mysql_numrows($result);
echo "<b><center>Database Result</center></b><br><br>";
$i=0;
while ($i < $nu) {
$i++;
}
if ($num==0) {
?>
<table width="800" border="0" align="center" cellpadding="0" cellspacing="0" height="14" >
<form action="tenantper.php" method="post" >
<td width="100%" align="center"><input type="hidden" name="sand" value="<? echo $_SESSION['reg_id']; ?>"><input type="hidden" name="surname" value="<? echo $last; ?>"><input type="hidden" name="firstname" value="<? echo $first; ?>"><input type="hidden" name="male_female" value="<? echo $male; ?>"><input type="hidden" name="dob" value="<? echo $dob; ?>"><input type="hidden" name="datesubmitted" value="<? echo $date; ?>"><input name="submit" type="submit" value="Add New Record"></td>
</tr>
</form>
</table>
<br>
<?
die("No Matching Names On Database Press the Above Button to Add a New Record.");
}
else {
$num_rows = mysql_num_rows($result);
echo "$num_rows Records Found with $first $last $male $dob";
}
mysql_close();
?>
<div align="CENTER">
<center>
<table border="0" width="600" height="300">
<tr>
<td width="100%" height="100" valign="top">
</div>
<table border="1" cellspacing="2" cellpadding="2">
<tr><align="center">
<th><font face="Arial, Helvetica, sans-serif">ID Number</font></th>
<th><font face="Arial, Helvetica, sans-serif">Surname</font></th>
<th><font face="Arial, Helvetica, sans-serif">Firstname</font></th>
<th><font face="Arial, Helvetica, sans-serif">Gender</font></th>
<th><font face="Arial, Helvetica, sans-serif">DOB</font></th>
<th><font face="Arial, Helvetica, sans-serif">Add new record</font></th>
</tr>
<?
$i=0;
while ($i < $num) {
$last=mysql_result($result,$i,"surname");
$first=mysql_result($result,$i,"firstname");
$dob=mysql_result($result,$i,"dob");
$sex=mysql_result($result,$i,"male_female");
$id=mysql_result($result,$i,"id");
?>
<tr>
<form action="addtd.php" method="get">
<th><input type="hidden" size="20%" value="<? echo $id; ?>" name="id"><? echo $id; ?></th>
<th><input type="hidden" size="20%" value="<? echo $last; ?>" name="surname"><? echo $last; ?></th>
<th><input type="hidden" size="20%" value="<? echo $first; ?>" name="firstname"><? echo $first; ?></th>
<th><input type="hidden" size="20%" value="<? echo $male; ?>" name="male_female"><? echo $male; ?></th>
<th><input type="hidden" size="20%" value="<? echo $dob; ?>" name="dob"><? echo $dob; ?></th>
<th><input type="hidden" size="20%" value="<? echo $_SESSION['reg_id']; ?>" name="landlordloid"><input type="submit" title="Click here to add a record against <? echo $first; ?> <? echo $last; ?> <? echo $dob; ?>" value="Add"></th>
</form>
</tr>
<?
$i++;
}
echo "</table>";
?>
as I mentioned without validation the form sends the $'s to gettd.php but with validation I cannot send the varible using '<meta http-equiv="refresh" content="0;url=gettd.php">';.
Am I looking at this wrong and do I need a different approach, I appologise in advance but i am still at the begining of my very steep PHP learning curve,
thanks roscor