0

So if i have a profiles page such as localhost/profile.php?u=user How can i redirect the client to an error page if he doesn't specify the "u" such as localhost/profile.php without the ?u= variable?

Is it possible?

Skatox
  • 4,237
  • 12
  • 42
  • 47

1 Answers1

2
<?php
if(!isset($_GET['u']) || empty($_GET['u'])) header('Location: page-to-reidrect.php');
Keyne Viana
  • 6,194
  • 2
  • 24
  • 55