For work reasons, a complete zip code database is required. The data on the Internet is relatively old and there is very little data. I really hope the post office can download the zip code for free, or you can have an interface. At last, I did not pay for it, and my eyes were settled in http://www.cpdc.com.cn/(China P
PHP + AJAX automatically completes the example: processing the zip code. After the customer enters a POSTCODE, zipcode. PHP receives it, extracts the corresponding data from the data table, and then returns it to the client in a certain format (separated by | ). After the customer enters a POSTCODE, zipcode. PHP receives it, extracts the corresponding data from the data table, and then returns it to the cli
In specific Web site programming projects, sometimes you need to use PHP script code to control the compression and decompression zip file. The following is a simple PHP zip decompression implementation code, the need for friends can refer to the next careful study of a bit.
After PHP installation comes with a
ZipCode
if (Document.regform.u_zipcode.value = = "") {
Alert ("Hint: You must enter a ZIP code!") ");
Document.regform.u_zipcode.focus ();
return false;
}
if (document.regform.u_zipcode.value.length!=6) {
Alert ("Hint: Zip length not correct!") ");
Document.regform.u_zipcode.focus ();
return false;
}
bstring = "0123456789";
for (i = 0;
/**********************
* @file-path to zip file
* @destination-destination directory for unzipped files
*/
function Unzip_file ($file, $destination) {
Create Object
$zip = new Ziparchive ();
Open Archive
if ($zip->open ($file)!== TRUE) {
Die (' Could not open archive ');
}
Extract contents to dest
At work, you always encounter a lot of text boxes that prohibit the input of non-numeric characters, such as mobile phone number and zip code.
Copy Code code as follows:
Zip code. This is the postal code of the United States. Currently, only the postal code in the United States is State-owned, and other industries are not State-owned. the reason for providing us zip code today is that you need to
related functions, so need to help third-party functions to use
Fortunately there is this PECL (the PHP Extension Community Library)
There is a RAR package can be used
But it has to be installed manually.
If Unix, you can refer to the following installation method
Fetch HTTP://PECL.PHP.NET/GET/RAR-X.X.X.TGZ
Gunzip rar-xxx.tgz
TAR-XVF Rar-xxx.tar
CD rar-xxx
Phpize
./configure make make install
Of course, if FreeBSD, it would be quicker to use port.
Cd/usr/ports/archivers/pecl-rar
Make
Make
PECL (The PHP Extension Community Library)There is a rar package available for use.However, you must install it manually.For Unix, refer to the following installation method:
Fetch http://pecl.php.net/get/rar-x.x.x.tgzGunzip rar-xxx.tgzTar-xvf rar-xxx.tarCd rar-xxxPhpize./Configure make install
Of course, if freebsd is used, port installation will be faster.
Cd/usr/ports/archivers/pecl-rarMakeMake install
Remember to restart apache after installationAfter installation, you can perform a test.C
Finally, let me find the solution, that is, to implement this function through the PHP program execution function, because there are too many things that can solve ZIP files now (if you do not believe it, you can go to the place where you have downloaded the software to find it, so you will not be disappointed, and I will not be wrong ).The following is the original file of the program:# Upload. php Tutorial The
Php obtains all the information (such as the address, postal code, country, and latitude and longitude) of the specified IP address. Php obtains all the information (such as address, zip code, country, and latitude and longitude) of a specified (guest) IP address. This document describes how to obtain the specified IP address (visitor) by using php) all IP inform
This function uses regular expressions to determine whether it is a valid zip code (fixed length.
The Code is as follows:
Copy code
// Function name: CheckPost ($ C_post)// Usage: Determine whether the zip code
Zip:pclzip http://www.phpconcept.net/pclzip/index.en.php
rar:pecl rar Http://pecl.php.net/package/rar
In the past to perform the decompressor under PHP, the most common way is to write command and then use EXEC () and other execution functions to run
This may be possible under Windows, but switching to UNIX can be a problem for account permissions and cannot be executed successfully
Is there a way of providing a function that can be used directly without having to go to the command to run?
The a
The problem was discovered by chance when this compilation was published in the previous period:
Zip error:invalid Command Arguments (cannot repeat names in zip file) Make: * * * [out/target/product/k200_hdmiin/system/etc /recovery-resource.dat] Error 16make: * * * waiting for unfinished jobs ....
Background Introduction
Bo Master is currently engaged in Androidtvbox development, based on Androi
functions to use
Fortunately there is this PECL (the PHP Extension Community Library)
There is a RAR package can be used
But it has to be installed manually.
If Unix, you can refer to the following installation method
Fetch HTTP://PECL.PHP.NET/GET/RAR-X.X.X.TGZ
Gunzip rar-xxx.tgz
TAR-XVF Rar-xxx.tar
CD rar-xxx
Phpize
./configure make make install
Of course, if FreeBSD, it would be quicker to use port.
Cd/usr/ports/archivers/pecl-rar
Make
Make install
Remember to restart Apache after insta
Use an open-source Ajax Library: Ajax toybox
Description:When registering or checking out a shopping cart, you need to fill in your personal data. This step can be concise. We only need to fill in the zip code for the guests and then follow the zip code, the database automatically retrieves the corresponding province,
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.