
November 23rd, 2012, 09:56 PM
|
 |
Learning all I can
|
|
Join Date: Dec 2007
Location: Pleasanton, California, USA
Posts: 287
  
Time spent in forums: 2 Days 9 h 25 m 9 sec
Reputation Power: 7
|
|
|
Header("Location: $variableHere")
I searched online and can find no specific info on my issue.
The start session script evaluated at the top of my website files includes these lines:
PHP Code:
$redirect = 'http://whatever.com/login.php'; // redirect to login page if rejected
// if session variable is not set, redirect to login page
if (!isset($_SESSION['authenticated']) || $_SESSION['authenticated'] != 'HighTimes') {
header("Location: $redirect");
exit;
}
In that next-to-last line, it seems that the variable is naked between those double quotation marks,
and would therefore not be evaluated. Can you tell me if that line should instead read:
header("Location: {$redirect}");
with curly braces around the $redirect variable name?
Thank you,
Curtis
__________________
Curtis
- living a newbie's dream
|