- Joined
- Aug 18, 2009
- Messages
- 269
- Reaction score
- 119
PHP:
<?PHP
function mssql_real_escape_string($str) { return str_replace("'","''",$str); }
$item = mssql_real_escape_string($_REQUEST["item"]);
$fromnum = mssql_real_escape_string($_REQUEST["fromnum"]);
$extid = mssql_real_escape_string($_REQUEST["extid"]);
$mobio_remote_addrs = array("87.120.176.216", "194.12.244.114");
$servID = 18912;
$db_serv = 'localhost';
$db_user = 'sql username';
$db_pass = 'sql password;
$db_name = 'MuOnline';
$stone_to_add = 'колко стонета';
if(in_array($_SERVER['REMOTE_ADDR'], $mobio_remote_addrs)) {
$sms_reply = 'Greshka.Spazvaite tochno instrukciite.';
$conn = mssql_connect($db_serv, $db_user, $db_pass);
if($conn) {
mssql_select_db($db_name);
$res = mssql_query("SELECT Stone FROM StoneRena WHERE acc='$item'");
if(mssql_num_rows($res)>0) {
mssql_query("UPDATE StoneRena SET Stone=Stone+'$stone_to_add' WHERE acc='$item'");
}else{
mssql_query("INSERT INTO StoneRena (acc, Stone) VALUES('$item', '$stone_to_add')");
}
$res = mssql_query("SELECT Stone FROM StoneRena WHERE acc='$item'");
if(mssql_num_rows($res)>0) {
$row = mssql_fetch_row($res);
$sms_reply = "Vashite stone bqha uspeshno zakupeni. Imate ".$row[0]." stoneta.";
}
}
}
?>
Това е скрипт за mobio.bg