简体   繁体   English

我怎样才能被重定向到管理面板旅行而不是网站的主页?

[英]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.

相关问题 我如何从 WP 旅行插件自定义结帐页面 - How can i customize a checkout page from WP travel plugin 如何确保只有从特定功能重定向的用户才能访问我的网站页面? - How can I make sure that a user visits a page of my site only if he's redirected from a specific function? 在WordPress中,如何在页面图块旁边添加文本,在管理面板中添加(无标题)作为标题? - In WordPress how can I add text next to the Page tile, with (no title) as the title, in admin panel? 在 wordpress 中,有没有办法从主站点而不是管理面板将帖子添加为草稿? - In wordpress, is there a way to add posts as drafts from the main site, not the admin panel? 我如何在 WordPress 管理面板编辑帐户页面上显示终极会员插件的输入元字段以供管理员编辑? - how can I display ultimate member plugin's input meta fields on WordPress admin panel edit account page for editing by the admin? 我可以登录wordpress admin,但是当我转到网站页面时,为什么会出现“ localhost重定向您太​​多次”的问题? - I can log in to the wordpress admin but when I go to the site pages, why does 'localhost redirected you too many times' come up? 我只能在进入被阻止的页面并被重定向后才能登录我的网站吗? - I can only log into my site after going to a blocked page and getting redirected? 如何在 PHP 中为重定向的索引页提供参数 - How can I give parameter to redirected index page in PHP 如何将PHP变量放置到重定向页面上 - How can i get PHP variables on to a redirected page 对于用户面板和一个管理员面板,如何同时使用$ _SESSION? - With a panel for the user and one for the admin, how can I use $_SESSION for both?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM