48 lines
1.1 KiB
PHP
48 lines
1.1 KiB
PHP
<?php
|
|
$ini = parse_ini_file("conf.ini", true);
|
|
|
|
mysql_connect($ini['db']['host'],$ini['db']['user'],$ini['db']['pass']);
|
|
mysql_select_db($ini['db']['db']);
|
|
|
|
if ($ini['db']['log']=="1"){
|
|
$arrival_time=microtime(true);
|
|
$filename=basename(__FILE__);
|
|
$filename="log_".$filename.".txt";
|
|
$chunck=strval($arrival_time)." ".$_SERVER['REQUEST_URI']."\r\n";
|
|
file_put_contents($filename,$chunck,FILE_APPEND);
|
|
}
|
|
|
|
mysql_set_charset("utf8");
|
|
|
|
$nick=$_REQUEST['nick'];
|
|
$uID=$_REQUEST['uID'];
|
|
|
|
$country=$_REQUEST['country'];
|
|
$sex=$_REQUEST['sex'];
|
|
$town=mysql_real_escape_string($_REQUEST['town']);
|
|
$birth=$_REQUEST['birth'];
|
|
|
|
$sql=mysql_query("select ID from contest_nick where nick='$nick' and uID='$uID' limit 1");
|
|
if (mysql_num_rows($sql))
|
|
{
|
|
$id=mysql_result($sql,0,"ID");
|
|
$match=1;
|
|
}
|
|
else
|
|
{
|
|
$match=0;
|
|
}
|
|
|
|
if ($match==1)
|
|
{
|
|
$sql=mysql_query("update contest_nick set country=$country,town='$town',sex=$sex,birth='$birth',updated=1 where ID=$id");
|
|
print('ok');
|
|
}
|
|
else
|
|
{
|
|
print('ko');
|
|
}
|
|
|
|
mysql_close();
|
|
?>
|