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,147
  • 11
  • 42
  • 46

1 Answers1

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