Possible Duplicate:
PHP session side-effect warning with global variables as a source of data在php中的會話register_globals警告
我通過PHP獲得Ajax響應。 我得到這個錯誤:
PHP Warning: Unknown: Your script possibly relies on a session side-effect which existed until PHP 4.2.3. Please be advised that the session extension does not consider global variables as a source of data, unless register_globals is enabled. You can disable this functionality and this warning by setting session.bug_compat_42 or session.bug_compat_warn to off, respectively in Unknown on line 0
我該如何解決它?
我的PHP腳本是
<?php
include("include/config.inc.php");
$name = $_POST['loginname'];
$phone = $_POST['logintelephone'];
// To protect MySQL injection
$name = stripslashes($name);
$phone = stripslashes($phone);
$name = mysql_real_escape_string($name);
$phone = mysql_real_escape_string($phone);
$query = mysql_query("select * from chatapp_users where name = '$name' and phone_no = '$phone'");
// Mysql_num_row is counting table row
$count=mysql_num_rows($query);
// If result matched $myusername and $mypassword, table row must be 1 row
if($count > 0){
$result = mysql_fetch_array($query);
session_start();
$_SESSION['currentuser'] = $name;
$_SESSION['currentuserid'] = $result['user_id'];
$_SESSION['phone'] = $result['phone'];
echo 1;
}else {
echo 2;
}
?>
正如通知所說:這是_Warning_,而不是_Error_。它有一個完美的解釋它是什麼。那麼你的問題是什麼? – arkascha
如何解決..? –