Rookie write the message board login code you big God help me See, why to click Login two times to log in, why click two times to exit?

Source: Internet
Author: User
Code written by PHP rookie

Rookie write the message board login code you big God help me See, why to click Login two times to log in, why to click two times to exit to quit? The problem is where the big God help me see, thank you first. The code is as follows:
 
   
 
    Exit
 
  


Reply to discussion (solution)

I do not know what is wrong, look at the big God to guide the Fan Sutra

After correcting the "variable undefined" warning, you do not see the phenomenon you said
But you can't rule out a problem in sql.php or head.php.

Post your include file to see if it's strange.

Post your include file to see if it's strange
sql.php File Code:

 
  ", Str_replace (" "," ", $content));       return $content; }//the input spaces with str_replace ("\ n", "
", Str_replace (" "," ", $content)) is replaced by the format that PHP can accept, and what format is displayed for the input. >

head.php File Code:
 
  
 
  
 
  

textbook.php File Code:
 
  

list.php File Code:
 
  
 
  
  
ID sequence: Title: User: Content:

After correcting the "variable undefined" warning, you do not see the phenomenon you said
But you can't rule out a problem in sql.php or head.php.
Variable undefined is not referring to here

Setcookie ("cookie", "out");
changed to Setcookie ("Cookie", "Out", Time ()-3600);

-------------
Setcookie ("Cookie", "OK");
Change to
Setcookie ("Cookie", "OK", Time () +3600);

Setcookie ("cookie", "out");
changed to Setcookie ("Cookie", "Out", Time ()-3600);

-------------
Setcookie ("Cookie", "OK");
Change to
Setcookie ("Cookie", "OK", Time () +3600);
I change or click two times to log in, you can click two times to exit.
Setcookie ("Cookie", "Out", Time ()-3600);
echo "";
}
if ($_post[id]== ' xxx ')
{
$PW =md5 ($_POST[PW]);
if ($PW = = ' e1bfd762321e409cee4ac0b6e841963c ')
{
Setcookie ("Cookie", "OK", Time () +3600);
echo "";
}
}

localhost.href= ' login.php ';

Not supposed to be location.href=?

all localhost should be location

  • 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.