Reply to Re: $_SESSION - $_GET - reloading page problem

Your name:

Reply:


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

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация