Re: Nead Help With A Php Script
| From: | martinahingis | Date: | Mon, 01 Apr 2002 00:18:37 +0000 |
| Subject: | Re: Nead Help With A Php Script | ||
| References: | 1 | Groups: | php.general php.test php.windows |
| Request: | Send a blank email to php-general+get-90899@lists.php.net to get a copy of this message | ||
"Alain Kumschick FrançOis Robert" <akumschick@kumschicknw.com> wrote in
message news:20020329202840.9082.qmail@pb1.pair.com...
> 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 not loged in!
>
> thanks for any help
>
>
> alain kumschick
> akumschick@kumschicknw.com
> http://www.kumschicknw.com
>
>
//simply chech the username as a cookie
if(!isset($HTTP_COOKIE_VARS["username"])
{
header("Location: loginerror.php"); //no cookie forward to the
loginerror.php
}
else
{
//cookie exists. you should check whether the username is valid. besides
your code is going here
}
-----------------------------
martina.