:::

5-5 /ajax.php

<?php
include "../../mainfile.php";

$county=$_POST['county'];
$def_city=$_POST['city'];

$sql = "select city from `" . $xoopsDB->prefix("phone_book") . "` where county='{$county}' group by city order by zip";
$result = $xoopsDB->query($sql) or redirect_header($_SERVER['PHP_SELF'], 3, mysql_error());
echo "<option value=''>選擇鄉鎮市區</option>";
while (list($city) = $xoopsDB->fetchRow($result)) {
    $selected=($city==$def_city)?'selected':'';
    echo "<option value='{$city}' $selected>{$city}</option>";
}

 


:::

搜尋

QR Code 區塊

https%3A%2F%2Fwww.tad0616.net%2Fmodules%2Ftad_book3%2Fpage.php%3Ftbsn%3D39%26tbdsn%3D1244

書籍目錄

展開 | 闔起

線上使用者

32人線上 (8人在瀏覽線上書籍)

會員: 0

訪客: 32

更多…