PHP Landing Page
Include (' conn.php ');
Session_Start ();
if (Isset (' $_post[submit] ')) {
$sql = "Select * from Chen where name= ' $_post[user] ' and ' $_post[pwd] '";
$rs =mysql_query ($sql);
$row =mysql_fetch_array ($RS);
if ($row) {
"$time =time () +3600;
$_session[user]= ("Zhangsan", Time () +3600);
$_session[pwd]= "Zhangsan", 1);
$_session[]= ("longin.php", true, $time); "
Header ("location:index.php");
?>
Re-Login
Let me see, I don't know how to write, the conversion of the page
------Solution--------------------
PHP Code
This variable is within the single quotation mark, so it is not parsed and treated as a string. Isset () accepts a variable if (isset (' $_post[submit] ')) {// $_post key value is a string type, so use ' submit ' if (isset ' submit ') {// There is no Chinese in front of the ", or will report grammatical error" $time =time () +3600;//("Zhangsan", Time () +3600) is not an expression, and there is no return value. Variables are also case-sensitive $_session[user]= ("Zhangsan", Time () +3600),//Change to $_session[' user '] = ' zhangsan ';//If you want to set the session life cycle, You need to set session.cookie_lifetime in PHP.ini. But you don't have to worry about the basics.
------Solution--------------------
One is the quotation mark, one is the post,get these to capitalize.
------Solution--------------------