PHP語法錯誤,我有下面的PHP代碼的文件:,我無法找到
<?php
session_start();
include_once("config.php");
include_once("functions.php");
include_once("class/db.class.php");
$config = new config($db_host, $db_user, $db_pass, $db_name);
$db = new db($config);
$db->openConnection();
switch ($_POST['mode']) {
case 'update':
if(mysql_query("UPDATE table_name SET id_negozio = '".$_POST['negid']."', nome='".mysql_real_escape_string(strtolower($_POST['nome']))."', cognome='".mysql_real_escape_string(strtolower($_POST['cognome']))."', indirizzo='".mysql_real_escape_string($_POST['indirizzo'])."', CAP='".$_POST['cap']."', city='".mysql_real_escape_string($_POST['city'])."', tel='".$_POST['tel']."', email='".strtolower($_POST['email'])."', provincia='".strtoupper($_POST['provincia'])."', data_nascita = '".$_POST['datanascita']."', luogo_nascita='".mysql_real_escape_string($_POST['luogonascita'])."', doc_number='".strtoupper($_POST['docnum'])."', doc_type='".$_POST['doctype']."', doc_data='".$_POST['docdata']."', cf='".strtoupper($_POST['cf'])."', doc_exp='".$_POST['doc_exp']."', doc_rilascio='".$_POST['doc_rilascio']."' WHERE id = ".$_POST['id']." ")){
echo "ok";
}
break;
case 'salvataggio_finale':
if(mysql_query("UPDATE table_name SET salvato = 1 WHERE id = ".$_POST['id']." ")){
logit("Creato nuovo cliente.", $_POST['idneg']);
echo "ok";
}
break;
case 'del':
if(mysql_query("DELETE FROM table_name WHERE id = ".$_POST['id']." ")){
logit("Eliminato cliente con id ".$_POST['id']."", $_POST['idneg']);
echo "deleted";
}
break;
}
unset($db);
?>
在我的服務器我有顯示的error_log 38項給這個錯誤:
[..] PHP Parse error: syntax error, unexpected '{' in /home/.../filename.php on line 12
在哪裏第12行是如果陳述後案'更新' 我不明白爲什麼我不應該把括號或真正的錯誤是什麼。
那麼,你的數據庫會被PWNED:?d輸入錯誤 – vikingmaster
你是什麼意思? –
只是告訴我爲什麼你的一些'$ _POST'值被轉義了,有些不是? – vikingmaster