01.
<?
02.
03.
mysql_connect(
"localhost"
,
"root"
,
"1234"
);
04.
mysql_select_db(
"plmodel"
);
05.
mysql_query(
"SET character_set_results=tis620"
);
06.
mysql_query(
"SET character_set_client=tis620"
);
07.
mysql_query(
"SET character_set_connection=tis620"
);
08.
if
(trim(
$_POST
[
"txtUsername"
]) ==
""
)
09.
{
10.
echo
"¡ÃسҡÃÍ¡ª×èͤèÐ"
;
11.
exit
();
12.
}
13.
if
(trim(
$_POST
[
"txtNickname"
]) ==
""
)
14.
{
15.
echo
"¡ÃسҡÃÍ¡ª×èÍàÅ蹤èÐ"
;
16.
exit
();
17.
}
18.
if
(trim(
$_POST
[
"txtAge"
]) ==
""
)
19.
{
20.
echo
"¡ÃسҡÃÍ¡ÍÒÂØ¤èÐ"
;
21.
exit
();
22.
}
23.
if
(trim(
$_POST
[
"txtTel"
]) ==
""
)
24.
{
25.
echo
"¡ÃسҡÃÍ¡ªàºÍÃìµÔ´µèͤèÐ"
;
26.
exit
();
27.
}
28.
if
(trim(
$_POST
[
"txtTel2"
]) ==
""
)
29.
{
30.
echo
"¡ÃسҡÃÍ¡àºÍÃìâ·ÃÒµÔ¤èÐ"
;
31.
exit
();
32.
}
33.
if
(trim(
$_POST
[
"txtHeight"
]) ==
""
)
34.
{
35.
echo
"¡ÃسҡÃÍ¡ÊèǹÊÙ§¤èÐ"
;
36.
exit
();
37.
}
38.
if
(trim(
$_POST
[
"txtWeight"
]) ==
""
)
39.
{
40.
echo
"¡ÃسҡÃÍ¡¹éÓ˹ѡ¤èÐ"
;
41.
exit
();
42.
}
43.
if
(trim(
$_POST
[
"txtChest"
]) ==
""
)
44.
{
45.
echo
"¡ÃسҡÃÍ¡ÊÑ´Êèǹ¤èÐ"
;
46.
exit
();
47.
}
48.
if
(trim(
$_POST
[
"txtWaistline"
]) ==
""
)
49.
{
50.
echo
"¡ÃسҡÃÍ¡ÊÑ´Êèǹ¤èÐ"
;
51.
exit
();
52.
}
53.
if
(trim(
$_POST
[
"txtHips"
]) ==
""
)
54.
{
55.
echo
"¡ÃسҡÃÍ¡ÊÑ´Êèǹ¤èÐ"
;
56.
exit
();
57.
}
58.
if
(trim(
$_POST
[
"txtHead"
]) ==
""
)
59.
{
60.
echo
"¡ÃسҡÃÍ¡ÊÕ¼Á¤èÐ"
;
61.
exit
();
62.
}
63.
if
(trim(
$_POST
[
"txtEyes"
]) ==
""
)
64.
{
65.
echo
"¡ÃسҡÃÍ¡ÊÕµÒ¤èÐ"
;
66.
exit
();
67.
}
68.
if
(trim(
$_POST
[
"txtCapability"
]) ==
""
)
69.
{
70.
echo
"¡ÃسҡÃÍ¡¤ÇÒÁÊÒÁÒö¤èÐ"
;
71.
exit
();
72.
}
73.
$strSQL
=
"SELECT * FROM member WHERE Username = '"
.trim(
$_POST
['txtUsername
'])."'
";
74.
$objQuery
= mysql_query(
$strSQL
)
or
die
(mysql_error());
75.
$objResult
= mysql_fetch_array(
$objQuery
);
76.
if
(
$objResult
)
77.
{
78.
echo
"ª×è͹ÕéÁÕ¤¹ãªéáÅéǤèÐ"
;
79.
}
80.
else
81.
{
82.
$filename
=
"myfiles/"
.
$ran_num
.
$_FILES
[
"filUpload1"
][
"name"
];
83.
$strSQL
=
"INSERT INTO member (Username,Nickname, Age,Tel,Tel2,Height,Weight,Chest,Waistline,Hips,Head,Eyes,Capability,FilesName1) VALUES ('"
.
$_POST
[
"txtUsername"
]."',
84.
'".$_POST["txtNickname"]."'
,
'".$_POST["txtAge"]."'
,
'".$_POST["txtTel"]."'
,
'".$_POST["txtTel2"]."'
,
'".$_POST["txtHeight"]."'
,
'".$_POST["txtWeight"]."'
,
'".$_POST["txtChest"]."'
,
'".$_POST["txtWaistline"]."'
,
'".$_POST["txtHips"]."'
,
'".$_POST["txtHead"]."'
,
'".$_POST["txtEyes"]."'
,
'".$_POST["txtCapability"]."'
,
'".$_FILES["$filename"]."'
)";
85.
$objQuery
= mysql_query(
$strSQL
);
86.
87.
echo
"<center>ÊÁѤÃà»ç¹¹ÒÂẺ-¹Ò§áººàÃÕºÃéÍÂáÅéǤèÐ </center><br>"
;
88.
89.
echo
"<br> <center>Go to <a href='index.php'>¡ÅѺ˹éÒáá¤èÐ</center></a>"
;
90.
91.
}
92.
mysql_close();
93.
?>