标签: php html variables
所以如果我有个人资料页面,例如localhost/profile.php?u=user 如果他没有指定“{”,例如localhost/profile.php没有?u=变量,我该如何将客户端重定向到错误页面?
localhost/profile.php?u=user
localhost/profile.php
?u=
有可能吗?
答案 0 :(得分:2)
<?php if(!isset($_GET['u']) || empty($_GET['u'])) header('Location: page-to-reidrect.php');