Posts: 876
Name: Matt Pealing
Location: England, north west
|
I have one bit of code in a file:
PHP Code:
<?php session_start (); require '../authAdmin.php'; ?>
and this is in authAdmin.php:
PHP Code:
<?php
// restrict certain pages with this script // forward user to login page if not logged in
if ($_SESSION['userId'] != 1) { header ('Location: ' . $_SERVER['DOCUMENT_ROOT']; exit; }
?>
But instead of forwarding to the root directory, I keep getting this very unhelpful error message:
Quote:
|
Parse error: parse error in C:\xampp\htdocs\xampp\penguinpages.co.uk\script\ph p\authAdmin.php on line 7
|
Ive been trying for about half an hour to fix it and am getting nowhere. Ive even tried replacing the $_SERVER variable with the actual path. If I echo the $_SERVER variable it appears correct!?
|