因此,如果我有一个配置文件页面,如localhost/profile.php?u=user
如果客户端不指定"u"(如localhost/profile.php
)而不指定?u=
变量,我如何将其重定向到错误页面?
有可能吗?
<?php
if(!isset($_GET['u']) || empty($_GET['u'])) header('Location: page-to-reidrect.php');
因此,如果我有一个配置文件页面,如localhost/profile.php?u=user
如果客户端不指定"u"(如localhost/profile.php
)而不指定?u=
变量,我如何将其重定向到错误页面?
有可能吗?
<?php
if(!isset($_GET['u']) || empty($_GET['u'])) header('Location: page-to-reidrect.php');