01.
<?php
02.
$conn
= mysql_connect(
"localhost"
,
"root"
,
"1234"
)
or
die
(mysql_error());
03.
$sel
= mysql_select_db(
"db_fiberoptic"
);
04.
?>
06.
<html>
07.
<head>
08.
<meta http-equiv=
"Content-Type"
content=
"text/html; charset=utf-8"
>
09.
<title>Untitled Document</title>
10.
</head>
11.
<script type=
"text/javascript"
src=
"../../../jquery-1.7.1.js"
></script>
12.
<script language=
"JavaScript"
>
13.
function
resutName(localID)
14.
{
15.
switch
(localID)
16.
{
17.
<?
18.
$strSQL
=
"SELECT * FROM telex_data ORDER BY local_id ASC "
;
19.
$objQuery
= mysql_query(
$strSQL
);
20.
while
(
$Result
= mysql_fetch_array(
$objQuery
))
21.
{
22.
?>
23.
case
"<?=$Result["
local_id
"];?>"
:
24.
frmMain.localID.value =
"<?=$Result["
t_lat
"];?>,<?=$Result["
t_lng
"];?>"
;
25.
break
;
26.
<?
27.
}
28.
?>
29.
default
:
30.
frmMain.localID.value =
""
;
31.
}
32.
}
33.
</script>
34.
<body>
35.
<form action=
""
method=
"post"
name=
"frmMain"
>
36.
List Menu
37.
<select name=
"lmName1"
OnChange=
"resutName(this.value);"
>
38.
<option value=
""
><-- Please Select Item --></option>
39.
<?
40.
$strSQL
=
"SELECT * FROM telex_data ORDER BY local_id ASC"
;
41.
mysql_query(
"SET NAMES UTF8"
,
$conn
);
42.
$objQuery
= mysql_query(
$strSQL
);
43.
while
(
$Result
= mysql_fetch_array(
$objQuery
))
44.
{
45.
?>
46.
<option value=
"<?=$Result["
local_id
"];?>"
><?=
$Result
[
"local_id"
];?>
47.
<?
48.
}
49.
?>
50.
</select>
51.
<input name=
"localID"
type=
"text"
value=
""
size=
"50"
>
52.
</form>
53.
</body>
54.
</html>
55.
<?
56.
mysql_close();
57.
?>