-2
可能重复:
Syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in PHP会话管理
你好我想在PHP设计一个网页来实现类似的登录会话和概念,并logout.Below是我的基本码。
<?php
session_start();
$host = "localhost";
$username = "USERNAME";
$password = "PASSWORD";
$db = "test";
@mysql_connect($host,$username,$password) or die ("error");
@mysql_select_db($db) or die("error");
?>
我上线3,请帮助得到一个错误的unexpected_T_CONSTANT_ENCAPSED_STRING删除此error.Is它什么毛病SOL注入?
看这个问题:http://stackoverflow.com/questions/2719350/syntax-error-unexpected-t-constant-encapsed-string-in-php – kpotehin
有你尝试过使用框架?你不应该写你自己的登录代码;安全风险太大 –
您还应该使用'mysqli'函数而不是旧的不推荐使用的'mysql'。 – Cyclonecode