"Alain Kumschick FrançOis Robert" <[EMAIL PROTECTED]> wrote in
message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hello,
>
> I need a php script that checks if the there is a cookie set with the
users
> username
> and if not
> it brings you to an other page and telling you that you are no
> (c) Obviously, this won't prevent someone from
> faking a username via the querystring, so you have to
> specify that it's a cookie:
>
> if(!isset($_COOKIE["username"])) {
> header("Location: http://www.mysite.com/login.php";);
> exit;
> }
Note that nothing prev
Aaargh! typo...
> if(!session_is_registered("username")) "])) {
should be
if(!session_is_registered("username")) {
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
> I need a php script that checks if the there is a
> cookie set with the users username and if not it
> brings you to an other page and telling you that
> you are not loged in!
(a) Don't cross-post all over.
(b) Cookies 'automagically' become global variables, so
a simple version is
4 matches
Mail list logo