|
Posted by Janwillem Borleffs on 09/28/52 11:42
rcross@gmail.com wrote:
> I tried putting it just under the session_start(); but that returned
> an error that the "Page isn't redirecting properly." I'm not even
> sure what it's saying... :/ I did try placing the exit below it, but
> I did not even seem to be that far in the implementation yet. Any
> suggestions?
>
You should put the header and exit calls just after you have updated the
session, as in:
<?php
session_start();
// Update session
$_SESSION['foo'] = 'bar';
// Redirect
header("Location: {$_SERVER['PHP_SELF']}"),
exit;
?>
Note that the use of a relative path for the Location header might cause
problems, in which case you should apply an absolute URL.
JW
Navigation:
[Reply to this message]
|