OK, i think this will give you an IDEA ..
The form Page will contain :
<form method='post' action='page.php'>
<input type='text' name='x' size=20'>
<input type='submit' name='submit' value='GO'>
</form>
and in the page of PHP u have to incode:
<?php
#check if the user entered any thing in the form and if not #WARNING
if ($x==''){
echo "No Data Entered, please go back ... "
exit();
}
#Place tha connection to DB
$db=mysql_connect(....etc
#and select the database u wanna work on it ..
#Check if the value entered in Table1:
$statment="select *from table1 where field_name='$x' ";
$result=mysql_query($statment,$db);
if (!$result){
echo" Bad Query, Call webmaster ...";
exit();
}
$y=mysql_affected_rows();
#this will return 0 if not entered in the table 1 and 1 if presented #in table 2
and work on it as follow:
if ($y==0){
--- do here whatever u want to do if it is in TABLE1 ---
}else{
---do here whatever u want to do if not in TABLE1 ---
}
thats the way i think u want ...
any way come back for any troubles😉 good luck