PHP landing page, how to solve

Source: Internet
Author: User
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--------------------
  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.