Kod:
<?
// CONNECTIONS =========================================================
$host = "mysql.hostinger.web.tr"; //put your host here
$user = "u882958212_kk"; //in general is root
$password = "00qq00qq"; //use your password here
$dbname = "u882958212_kk"; //your database
mysql_connect($host, $user, $password) or die("Cant connect into database");
mysql_select_db($dbname)or die("Cant connect into database");
// =============================================================================
// PROTECT AGAINST SQL INJECTION and CONVERT PASSWORD INTO MD5 formats
function anti_injection_login_senha($sql, $formUse = true)
{
$sql = preg_replace("/(from|select|insert|delete|where|drop table|show tables|,|'|#|\*|--|\\\\)/i","",$sql);
$sql = trim($sql);
$sql = strip_tags($sql);
if(!$formUse || !get_magic_quotes_gpc())
$sql = addslashes($sql);
$sql = (trim($sql));
return $sql;
}
// THIS ONE IS JUST FOR THE NICKNAME PROTECTION AGAINST SQL INJECTION
function anti_injection_login($sql, $formUse = true)
{
$sql = preg_replace("/(from|select|insert|delete|where|drop table|show tables|,|'|#|\*|--|\\\\)/i","",$sql);
$sql = trim($sql);
$sql = strip_tags($sql);
if(!$formUse || !get_magic_quotes_gpc())
$sql = addslashes($sql);
return $sql;
}
// =============================================================================
$unityHash = anti_injection_login($_POST["myform_hash"]);
$phpHash = "hashcode"; // same code in here as in your Unity game
$nick = anti_injection_login($_POST["myform_nick"]); //I use that function to protect against SQL injection
$pass = anti_injection_login_senha($_POST["myform_pass"]);
$Og = anti_injection_login($_POST["myform_Og"]);
$Level = anti_injection_login($_POST["myform_Level"]);
$Exp = anti_injection_login($_POST["myform_Exp"]);
mysql_query("INSERT INTO scores(level,og,exp)VALUES('$Level','$Og','$Exp')");
// Close mySQL Connection
mysql_close();
?>
Şu kod ile oyundaki bilgileri alıp databaseye atio çok güzel fakat attıkları her şeyi yeniden oluşturuyo ben oluşmuş bi kullanıcının level değişkenini değişmek istiyom acaba yardım edebilecek varmı