如果用户想要再次填写登录表单并在用户当前登录时将其提交,会发生什么? 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);}