zip and USPS
| From: | Hans H. Anderson | Date: | Mon, 17 Jul 2000 18:18:58 +0000 |
| Subject: | zip and USPS | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-6960@lists.php.net to get a copy of this message | ||
On Mon, 17 Jul 2000, Ruy P. Delgado wrote:
> I can do a js that would Table1Form.submit() with my database fields but
> how exactly can I get this information into PHP variables? how can I parse
> the resulting page from the usps site?
Just jumping in here, Ruy, but the Javascript will submit the form, but it
can be returned and parsed via PHP.
Actually, would it be possible to just POST the data to a fsockopen() call
and read the response... eliminating the need for Javascript? There are a
slew of tools out there to do this (I have one such tool at
http://www.hansanderson.com/php/, LWP-ish tool).
I've done some scripts
like this, that post to a server and read the response, parse it and take
conditional steps (update databases, output errors, etc). The only hard
part is getting the parsing correct, as it can change frequently. If the
USPS is consistent, this won't take long, though.
Hans Anderson ~ me@hansanderson.com
PO Box 426, Missoula, MT 59806 | PHP, Search Engines, SQL
(800)397-9116 / (406)549-6524 | Databases, Flash Multimedia,
http://www.hansanderson.com | Killer Audio Production,
http://www.goofiness.com | Minty Fresh Breath.