01.
<strong>Code (C#)</strong>
02.
<span
class
=
"notranslate"
><font
class
=
"css_code"
><pre
class
=
"brush:cs"
></pre></font></span>
03.
04.
<?php
05.
@header (
'Content-type: text/html; charset=utf-8'
);
06.
include
(
'client_setting.php'
);
07.
$connect
= mssql_connect(
$dbhost
,
$dbusername
,
$dbpassword
);
08.
if
( !
$connect
) {
echo
"ติดต่อกับฐานข้อมูล Mssql ไม่ได้ "
;
exit
(); }
09.
$condb
= mssql_select_db(
$db
);
10.
if
(
$_POST
[input] =
"input"
){
11.
12.
$id
=
addslashes
(
$_POST
[username]);
13.
$password
=
addslashes
(
$_POST
[password]);
14.
$email
=
addslashes
(
$_POST
[email]);
15.
$re_email
=
addslashes
(
$_POST
[re_email]);
16.
$sql
=
"select email from game_acc where account='$id' and password ='$password'"
;
17.
18.
if
(
$objQuery
= mssql_query(
$sql
)==1){
19.
$objEmail
= mssql_fetch_object(
$objQuery
);
20.
if
(
strnatcasecmp
(
$objEmail
->email, null)==0){
21.
if
(
strcmp
(
"$email"
,
"$re_email"
)==0){
22.
$sql
=
"update $login_table set email = '$email' where account = '$id' and password ='$password'"
;
23.
if
(mssql_query(
$sql
)) {
24.
echo
"<script>alert('add email complete ');</script>"
;
25.
echo
'<meta http-equiv="refresh" content="0;URL=./">'
;
26.
}
else
{
27.
echo
"<script>alert('Error Please enter the back buttom to word data again');</script>"
;
28.
echo
'<meta http-equiv="refresh" content="0;URL=./">'
;
29.
}
30.
}
else
{
31.
echo
"<script>alert('email and re-email not match press back button to word data again');</script>"
;
32.
echo
'<meta http-equiv="refresh" content="0;URL=./">'
;
33.
}
34.
}
else
{
35.
echo
"<script>alert('this username can't add email ');</script>"
;
36.
}
37.
}
else
{
38.
echo
"<script>alert('username or password wrong');</script>"
;
39.
}
40.
}
41.
?>