|
Posted by Alec on 07/05/06 21:07
Krustov
Thanks for the reply, will try to better explain.
Step 1
In my database I have a list of towns each with fields for 'townname',
'townref' and 'towntitlepic'.
I have a form where the user enters a unique 'townref' number and
submits the form. The code below checks to see if this unique 'townref'
number can be found in the database, and when so then extracts the
related fields 'townname' and 'towntitlepic'.
---------------
<?php $townref = $_GET['town']; echo $townref; ?>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="get">
<p align="center">
<p align="center"> <font color="#FF0000">town id</font><input
type="text" name="town" size="20" value="" />
<input type="submit" value="GO" />
</p>
</form>
<?php
$resulttown = @mysql_query ("SELECT townname, townref, towntitlepic
FROM townid_uks49179 WHERE townref='$townref'");
while ($row = mysql_fetch_array($resulttown))
{
$townname = $row['townname'];
$townref = $row['townref'];
$towntitlepic = $row['towntitlepic'];
}
?>
-------------------
Step 2 - The search works OK and returns the correct 'townname' and
'towntitlepic' that relate to the entered 'townref' value in the form
(its really just a check to see if the town ref entered actually
exists)
I want to then have a condition, so if the 'townref' does exist, this
and the related 'townname' and 'towntitlepic' variables are passed to a
second page called www.freeweekends.co.uk/formanswer.php. The user has
already clicked on the form submit to do the check, so how do I pass
the variables to the new page?
Sorry because I know the answer will be really simply.
Alec
Navigation:
[Reply to this message]
|