[英]how can I be redirected to the admin panel to travel and not to the main page of the site?
I'm working on a project that we were asked to do for an internship.我正在做一个我们被要求做实习的项目。 we have to set up an e-commerce website.
我们必须建立一个电子商务网站。 for this, we chose Voyager 1.4 for the administration of the site.
为此,我们选择了 Voyager 1.4 来管理网站。 I used
我用了
php artisan voyage:install
and I created an administrator with我创建了一个管理员
php artisan voyager: admin your@email.com --create
Everything was fine for me until I logged out now when I log back in I am directly redirected to the user side of my site and not to my Voyager 1.4 administration panel.一切对我来说都很好,直到我现在注销,当我重新登录时,我被直接重定向到我网站的用户端,而不是我的 Voyager 1.4 管理面板。
My concern is how can I solve this problem in such a way that I can log into my admin panel and that user who wants to buy at the site level is also often redirected to his user page.我关心的是如何解决这个问题,以便我可以登录到我的管理面板,并且想要在站点级别购买的用户也经常被重定向到他的用户页面。
when you enter your credentials, then execute php code (example):当您输入您的凭据时,然后执行 php 代码(示例):
if(isset($_POST['loginbutton'])){
$admin_email = mysqli_real_escape_string($con, $_POST['admin_email']);
$admin_pass = mysqli_real_escape_string($con, $_POST['admin_pass']);
$get_admin = "select * from admin_database where admin_email='$admin_email' AND
admin_pass='$admin_pass'";
$run_admin = mysqli_query($con,$get_admin);
$count = mysqli_num_rows($run_admin);
if($count==1){
$_SESSION['admin_email']=$admin_email;
echo "<script>alert('Logged in. Welcome Back')</script>";
echo "<script>window.open('page.php?redirected_page','_self')</script>";
}else{
echo "<script>alert('Email or Password is Wrong!')</script>";
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.