| 
	
 | 
 Posted by Alec on 07/03/06 19:48 
Sorry but I have a beginners question. 
 
(see www.freeweekends.co.uk/formask.php) 
 
I have a form that checks for a unique id $townref of a given town 
 
If this unique id is entered and found, I then want the associated 
variables $townname and $towntitlepic passed to the url 
www.freeweekends.co.uk/formreply.php 
 
Have passed variables to a different URL within a form submit, but how 
do I do this within a normal condition statement?? 
 
Code --------------------------- 
 
<?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']; 
} 
?> 
 
<?php if (isset($GET['resulttown'])) ?> ???????? URL formreply.php and 
variables ??????? 
 
 
Many thanks 
 
Alec
 
  
Navigation:
[Reply to this message] 
 |