Redirection if a condition is met
- From: aeldaly@xxxxxxxxx
- Date: 27 Jul 2005 20:24:12 -0700
I know this topic has been discussed a few times here and also on
php.net, but I cannot find an answer to my specific problem. I check to
see if a user is logged in before serving admin.php like so:
<?php
session_start();
if (!isset($_SERVER['username']) or !isset($_SERVER['password'])) {
header("location:http://linux-place.com");
exit;
}
?>
These are the very first lines in the file. It works perfectly. The
problem is that I would like to output a message like "Please login
first before accessing the administration panel". How can I do that
without getting the headers already sent error?
Thanks,
Ahmed El-Daly
.
- Follow-Ups:
- Re: Redirection if a condition is met
- From: Jean-Baptiste Nizet
- Re: Redirection if a condition is met
- From: chotiwallah
- Re: Redirection if a condition is met
- Prev by Date: Re: turn off register_globals on a shared server
- Next by Date: HELP! PHP/MySQL Call...
- Previous by thread: Question about references
- Next by thread: Re: Redirection if a condition is met
- Index(es):
Relevant Pages
|