I don't understand exactly what you want to do. The referrer isn't necessarily going to be accurate, but unless the user is intentionally tricking it (or the browser just doesn't send it!) it should be accurate.
But this code will do exactly the same thing regardless of what the referrer was. Is that intentional?
PHP Code:
<?php
$referrer = $_SERVER['HTTP_REFERER'];
if (preg_match("/index.php/",$referrer)) {
header('Location: http://web-user.info/enlighten/index.php');
} else {
header('Location: http://web-user.info/enlighten/index.php');
};
?>
Do you want users to be able to visit the page if they choose to? Or should it always redirect them? If so, just use a redirect:
PHP Code:
<?php
header('Location: http://web-user.info/enlighten/index.php');
?>
Additionally: you do not need a semicolon to end an if statement's {}. So it's just if () {}, not if () {};.
Bookmarks