:::

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%2Fmail.tad0616.cp22.secserverpros.com%2Fmodules%2Ftad_book3%2Fpage.php%3Ftbdsn%3D1244%26tbsn%3D39

書籍目錄

展開 | 闔起

線上使用者

363人線上 (149人在瀏覽線上書籍)

會員: 0

訪客: 363

更多…