登录提交按钮将我带到空白页

时间:2018-10-11 08:38:16

标签: php forms login

登录页面(index.php)在提交按钮后显示空白页面。应该转到apartamente.php,但保留在index.php上,并留有空白页 代码是:

<?php
include("inc/db.php");
include("inc/functii.php");
if ((strlen($_SESSION['adm']))>1){
    header('location: apartamente.php');
}
if (isset($_POST['login'])) 
{
    if ((strlen($_POST['adm']))<1) {
        $eroare="Nu ati completat campul 'Utilizator'";
    }
    elseif ((strlen($_POST['pwd']))<1) {
        $eroare="Nu ati completat campul 'Parola'";
    }else{
        $adm = curata($_POST['adm']);
        $pwd = curata($_POST['pwd']);
        login($adm,$pwd);
        return $eroare;
    }
}

include("inc/header.php");  
include("inc/mijloc.php");

echo $eroare;
if (isset($_GET['wrongpass'])) {
    echo 'Parola introdusa nu este corecta!';
}
?>

<form action="index.php" method="post">
<table><tr><td colspan="2"> Login </td></tr><td>Utilizator</td><td><input type="text" name="adm"></td></tr>
<tr><td>Parola</td><td><input type="password" name="pwd"></td></tr>
<tr><td colspan="2"><input type="submit" name="login" value="Login"></td></tr>
</table>
</form>

0 个答案:

没有答案