Php 无法加载联系人页面

Php 无法加载联系人页面,php,Php,这是我网站的索引文件。我想加载联系人页面,但它不工作。我如何处理我的代码。多谢各位 <?php $Page = (isset($_GET["p"])); include('includes/header.php'); if ($Page == "contact"){ include('pages/contact.php'); } else { include('pages/home.php'); } include('incl

这是我网站的索引文件。我想加载联系人页面,但它不工作。我如何处理我的代码。多谢各位

<?php 
$Page = (isset($_GET["p"]));

include('includes/header.php');

if ($Page == "contact"){
    include('pages/contact.php');
} else {
    include('pages/home.php');
}

include('includes/footer.php');?>

isset
生成一个布尔值,因此
$Page
将为
true

试试这个:
$Page=isset($\u GET[“p”])$_GET[“p”]:空
$Page=$\u GET[“p”]??无效

您所说的“它不工作”是什么意思?
isset
返回一个布尔值。因此,
isset($\u GET[“p”])
将返回true或false,而不是您期望的联系人。