当用户登录时重新登录网站

时间:2015-07-31 08:51:33

标签: php

如果用户想要再次填写登录表单并在用户当前登录时将其提交,会发生什么? login.php如下:

<?php
    session_start();
    if($_SERVER["REQUEST_METHOD"] == "POST") {
        $username = $_POST['username'];
        $password = $_POST['password'];
        //check fields and if they are exist
        $_SESSION['login_user'] = $username;
        //redirect to profile.php.
        else {//the username or the password is incorrect.}
    }
    else {mysql_close($connection);}

0 个答案:

没有答案