我试图在接收到 GET 值时将我的 php 标头定位到特定位置,如果该值不正确,它将定位到默认位置,如 home.php
这是我到目前为止所做的
<?php
// Check which page is queried
if(isset($_GET['page'])){
$got = $_GET['page'];
}
else {
$got = 'home';
}
// Now goto that location
if(header('Location: '.$got.'.php')){
header('Location: '.$got.'.php');
}
else {
header('Location: home.php');
}
?>