Landing page, how to deal with it

Source: Internet
Author: User
Landing page
Include ' coon.php ';
@ $username =$_post[username];
@ $password =$_post[password];
$MD 5_pass=md5 ($password);
if (@$_get[out]) {
Setcookie ("Cookie", "out");
echo "";
}
$query = "Select Username,password from user where username= ' $username '
and password= ' $md 5_pass ' ";
$result =mysql_query ($query);
$num _rows=mysql_num_rows ($result);
$row =mysql_fetch_array ($result);
if ($num _rows>0)
{
$passsword 1= $row [' Password '];
if ($passsword 1== $password)
{
Setcookie ("Cookie", "OK");
echo "";
}
}
else {
echo "";
}
if (@$_cookie[' COOKIE ']!= ' OK ') {
?>


}else{
?>
Exit
}
?>
You can't just log in, you can't quit.

------Solution--------------------
_cookie on the second page (re-refresh) to take effect, you directly in a page to create and judge of course it is not possible to change into a session
------Solution--------------------
That $query you write like that seems a little dangerous.
------Solution--------------------
Http://blog.sina.com.cn/s/blog_71ed1b870100yxz8.html
PHP Simple Login Exit code
------Solution--------------------
discuss
......

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