Page 1 of 1

header parse error

Posted: Mon Jul 02, 2007 9:01 am
by m2babaey
Hi
this code:

Code: Select all

if ($user->_checkLogin($processed['username'], $processed['password'], $remember)) {
			if (isset($_SESSION['log_to'])) {

				header( Location: "$_SESSION['log_to']");
			}
On this line:

Code: Select all

header( Location: "$_SESSION['log_to']");
is sending a parse error. How can I fix it?
thanks

Posted: Mon Jul 02, 2007 9:03 am
by CoderGoblin

Code: Select all

header("Location: {$_SESSION['log_to']}");
exit;
Always put exit after header redirection.. or code continues processing

Posted: Mon Jul 02, 2007 3:46 pm
by RobertGonzalez

Code: Select all

<?php
header('Location: ' . $_SESSION['log_to']);
exit;
?>