|
Posted by Krustov on 07/05/06 22:23
<comp.lang.php>
<Alec>
<5 Jul 2006 14:07:48 -0700>
<1152133668.137407.66360@b68g2000cwa.googlegroups.com>
> <?php $townref = $_GET['town']; echo $townref; ?>
> <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="get">
>
> 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.
>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="get">
Havent tried the above - but doesnt clicking on submit take you to the
same webpage ? .
On the first page .....
<form action="formanswer.php" method="get">
<input type="text" name="towndemo" size="30">
<input type="text" name="junk" size="30">
<input type="submit" name="Submit" value="S U B M I T">
</form>
On the second page .....
<?php
$grab=$_POST['towndemo'];
$junk=$_POST['junk'];
(check town name against database)
(display results - if any)
?>
$grab will have/contain whatever text you typed into the form
$junk will have/contain whatever text you typed into the form
To sum up , Its better if you check and display on the second page .
--
Encrypted email address
www.emailuser.co.uk/?name=KRUSTOV
Navigation:
[Reply to this message]
|