English 中文(简体)
第6号 模块使用齐p代码获得城市名称
原标题:Drupal 6 Location Module get city name using zip code

I am using Location module and enabled Location CCK field. While creating content I am just collecting zip/postal code and country. I want to display the City name using the zip/postal code associated with node.

我知道,定位模块有锡普编码数据库。 是否需要问一下这个齐普/邮政编码数据库以获取城市名称? 如果无法使用这一手法/邮政法,那么解决办法是什么?

请指导我如何能够做到这一点?

最佳回答

Part of it has been resolved. This could be helpful for others. You can get zip/postal code information by the function available in the location module i.e. location_get_postalcode_data which accept Location parameter as array

@param $location
 *   Array. the location data
 *   -> the values are:
 *      street          => the string representing the street location (REQUIRED)
 *      additional      => the string representing the additional street location portion in the location form
 *      city            => the city name (REQUIRED)
 *      province        => the province code defined in the country-specific include file
 *      country         => the lower-case of the two-letter ISO code (REQUIRED)
 *      postal_code     => the postal-code (REQUIRED)

Also I did some modification in my country specific .inc file available in supported directory to fetch extra information along with default lat-lon info.

但是,如果在数据库中无法提供齐普/邮政编码,则有第二部分有待处理。

问题回答
public function 
{
    $null=  ;
    #   REFERENCE SITE URL = http://developer.yahoo.com/maps/rest/V1/geocode.html


    #   get and output "<Result>" elements
    $result=$xmlDoc->getElementsByTagName( Result );
    foreach ($result as $val)
    {
        return $null;
    }
}




相关问题
Brute-force/DoS prevention in PHP [closed]

I am trying to write a script to prevent brute-force login attempts in a website I m building. The logic goes something like this: User sends login information. Check if username and password is ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

定值美元

如何确认来自正确来源的数字。

Generating a drop down list of timezones with PHP

Most sites need some way to show the dates on the site in the users preferred timezone. Below are two lists that I found and then one method using the built in PHP DateTime class in PHP 5. I need ...

Text as watermarking in PHP

I want to create text as a watermark for an image. the water mark should have the following properties front: Impact color: white opacity: 31% Font style: regular, bold Bevel and Emboss size: 30 ...

How does php cast boolean variables?

How does php cast boolean variables? I was trying to save a boolean value to an array: $result["Users"]["is_login"] = true; but when I use debug the is_login value is blank. and when I do ...

热门标签