01.
<?php
02.
$xx
= isset(
$_POST
[
'xx'
]) ? mysql_real_escape_string(
$_POST
[
'xx'
]) :
''
;
03.
?>
04.
05.
<html>
06.
<head>
07.
<title></title>
08.
</head>
09.
<body>
10.
<form action=
""
method=
"POST"
>
11.
<select name=
"xx"
id=
"xx"
onchange=
"this.form.submit();"
>
12.
<option value=
""
>====SELECT====</option>
13.
<option value=
"picture"
<?php
if
(
$xx
==
"picture"
) {
echo
"selected"
;}?>>รูปภาพ</option>
14.
<option value=
"message"
<?php
if
(
$xx
==
"message"
) {
echo
"selected"
;}?>>ข้อความ</option>
15.
</select>
16.
</form>
17.
</body>
18.
</html>
19.
<?php
20.
if
(
$xx
==
'picture'
) {
21.
echo
"picture"
;
22.
}
else
if
(
$xx
==
'message'
) {
23.
echo
"message"
;
24.
}