4 回答
TA贡献2039条经验 获得超7个赞
$department = mysql_real_escape_string($_POST['department']);$name = mysql_real_escape_string($_POST['name']); $email = mysql_real_escape_string($_POST['email']);$message = mysql_real_escape_string($_POST['message']);
department
, name
, email
, message
TA贡献1876条经验 获得超7个赞
$_POST[department]
department
// Implicit declaration of constant called department with value 'department'define('department', 'department');
字符串缺少引号: $my_array[bad_key]
$department = mysql_real_escape_string($_POST[department]);...(etc)...
$department = mysql_real_escape_string($_POST['department']);...(etc)...
变量丢失美元符号: var_without_dollar
$
$this->
my_local; // should be $my_localmy_member; // should be $this->my_member
变量名中的无效字符: $bad-variable-name
-
_
if (123 === $my_var) { do_something();}
if (123 === $my-var) { do_something();}
if (123 === $my - var) { // variable $my minus constant 'var' do_something();}
引用类常量而不指定类范围
::
define()
.
class MyClass { const MY_CONST = 123; public function my_method() { return self::MY_CONST; // This is fine } public function my_method() { return MyClass::MY_CONST; // This is fine } public function my_bad_method() { return MY_CONST; // BUG - need to specify class scope }}
使用未在此版本的PHP中定义的常量,或在未安装的扩展中定义的常量
round()
PHP_ROUND_HALF_DOWN
$rounded = round($my_var, 0, PHP_ROUND_HALF_DOWN);
使用未定义的常量PHP_REAR_CONMIN_DU-假定的‘PHP_ALUT_HAND_DUD’警告(2):循环()
- 4 回答
- 0 关注
- 2018 浏览
添加回答
举报