简体   繁体   English

$ _GET始终返回管理员

[英]$_GET always returning admin

I'm currently busy on my index.php to include the via $_GET requested file. 我目前在index.php上忙于添加通过$_GET请求的文件。 The only problem is that it is always returning admin and never returning the declared value in the $_GET variable. 唯一的问题是,它总是返回admin而从不返回$_GET变量中的声明值。

All the files are in a directory used as subdomain. 所有文件都在用作子域的目录中。

Warning: include(pages/admin.php): failed to open stream: No such file or directory in /home/tjattern/domains/*censored*/public_html/admin/index.php on line 20

I am requesting http://admin.*censored*.nl/index.php?page=dashboard 我正在请求http://admin.*censored*.nl/index.php?page=dashboard

index.php

   <?php

error_reporting(E_ALL);
ini_set('display_errors', 1);

// include required files
require_once('core/config.php');
require_once('template/tpl_top.php');


if(isset($_COOKIE['as']))
{
   if(isset($_GET['page']))
   {
      $file = "pages/".$_GET['page'].".php";
     if(file_exists($file))
     {
      include($file);  // actual line 20
     }
     else
     {
      echo 'This page could not be found';
     }
   }
   else
   {
      include('pages/dashboard.php');
   }
}
else
{
 include('pages/login.php');
}


require_once('template/tpl_bot.php');

?>

http://ww.example.com/index.php?page=sample http://ww.example.com/index.php?page=sample

requesting this url 要求这个网址

$_GET['page'] in index.php end will be "sample" index.php结尾的$ _GET ['page']将为“样本”

Are you passing correct values in page atribute? 您是否在页面属性中传递正确的值?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM