Reply to Re: Posting to a URL

Your name:

Reply:


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">&nbsp;
<p align="center">&nbsp;<font color="#FF0000">town id</font><input
type="text" name="town" size="20" value="" />&nbsp;
<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

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация