Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Postcode Lookup

Status
Not open for further replies.

cybernetic

Programmer
Jul 30, 2001
6
GB
I have a postcodes tabel in mysql database and a form requiring peoples details. After clicking on a "Find Address " link the street and housenumber or the postcode and house number will be looked up in the database and the form reloaded with the remainder of the form completed. however when I try to relaod using met refresh I keep getting a warning. Can anyone help me with this?

Thanx
 
what's the error code that you're getting? leo

------------
Leo Mendoza
lmendoza@garbersoft.net
 
I am getting a Warning page but was putting the warning in the URL bar.

I was trying to do something like:

function postcodes () {

if ($streetname&&$houseno) {

$conn=mysql_connect("localhost","name","password");
$db=mysql_select_db("agency");
$sql="Select * from postcodes where houseno=$houseno and streetname=$streetname";
$res=mysql_query($sql,$conn);
$postcode=mysql_result($res,0,"postcode");

echo &quot;<meta http-equiv=\&quot;refresh\&quot; content=\&quot;3;
url=&quot;self.php?postcode=$postcode&&streetname=$streetname&&houseno=$houseno&quot;>&quot;;

}

The form should load with the values in the form cells. Any ideas?
 
have you tried rawurlencoding the values before you put them in the meta tag?

$postcode = rawurlencode($postcode)
etc..

you of course need to rawurldecode them in the ensuing page

$postcode = rawurldecode($HTTP_GET_VARS[&quot;postcode&quot;])

I know that NN will break on malformed URLS.


hth leo

------------
Leo Mendoza
lmendoza@garbersoft.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top