Women in Technology

Hear us Roar



Article:
  User-Friendly Form Validation with PHP and CSS
Subject:   header redirection
Date:   2004-08-24 07:23:41
From:   will_macdonald
I very often find it useful to put exit; after a redirect command. I've had buggy code that sent TWO redirection commands to the browser. Got v confusing.


As mentioned in the PHP manual:


http://uk.php.net/header


header("Location: http://www.example.com/"); /* Redirect browser */


/* Make sure that code below does not get executed when we redirect. */
exit;