首页 > 解决方案 > 提交表单后标题未重定向

问题描述

抱歉,如果询问这个类似的标题不起作用的问题,这是我的代码

<?php 
include_once 'config/koneksi.php';
session_start();
// LOGIN 
if(isset($_POST['btn_login'])){

    $user = $_POST['txt_user'];
    $pass = $_POST['txt_pass'];

    $select = $pdo->prepare("select * from admin where username='$user' and password='$pass' ");
    $select->execute();

    $row = $select->fetch(PDO::FETCH_ASSOC);

    if($row['username']==$user AND $row['password']==$pass){


        $_SESSION['id']=$row['id'];
        $_SESSION['username']=$row['username'];
        header('location: dashboard/dashboard.php'); 
        exit();

    }else{

    }

    }

?>

这是提交按钮后网址的结果,而不是重定向到仪表板页面

http://localhost/bukutamu/?txt_user=admin&txt_pass=admin&btn_login=

谁能帮我这个?对不起我的英语不好

标签: php

解决方案


推荐阅读