Re: Zip Codes
| From: | Jason Wong | Date: | Fri, 05 Nov 2004 01:27:48 +0000 |
| Subject: | Re: Zip Codes | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-201197@lists.php.net to get a copy of this message | ||
On Thursday 04 November 2004 16:59, bb9876 wrote:
> Is there any way to use PHP to determine the zip code someone is visiting
> from, assuming they are all from the US?
Something like this should work:
---------- start
<form action="<?php echo $_SERVER['PHP_SELF']; ?>"
method="POST">
Please input zipcode <input type="text" name="zipcode" value="">
<input type="submit" name="submit" value="Enter">
</form>
<?php
if (!empty($_POST['zipcode'])) {
echo "Whoa! your zipcode is {$_POST['zipcode']}";
}
?>
---------- end
--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
Thinking you know something is a sure way to blind yourself.
-- Frank Herbert, "Chapterhouse: Dune"
*/