Hello All:
Thanks again... I tried to use this and it is working fine for me.
Please comment:
<?
session_start();
if (session_is_registered("valid_user"))
include 'guest.html';
else include 'not_logged_in.php';
?>
Many Thanks
-Pushpinder
On Tuesday, February 4, 2003, at 12:32 PM, Goetz Lohmann wrote:
Pushpinder Singh Garcha schrieb:
Hello All:
My question is related to authentication. I have made a login system
using PHP Sessions and MySQL. Once the user gets authenticated on the
website I want to be able to allow him to see some html pages on the
website. Only users who have logged in are able to see such a files. I
have asked this question before , but still I have some doubts.
My code will check for:
if (session_is_registered($valid_user))
{
/// display the reqd page
}
else {
DISPLAY ERROR MESSAGE and ASK USER TO LOGIN
}
How should I display the page ... the page has a lot of html code and
trying to write echo " blah blah blah ..... ";
will not be a an option. Please suggest a way out .
you could include every page into a php script using
<?php
include('index.htm');
?>
this mean, that this page is like being copyed in the php file
also instead of
<?php
echo "bla bla bla":
?>
you always can do
<?php
...
?>
bla bla bla
<?php
...
?>
--
@ Goetz Lohmann, Germany | Web-Developer & Sys-Admin
\/ ------------------------------------------------------
() He's the fellow that people wonder what he does and
|| why the company needs him, until he goes on vacation.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Pushpinder Singh Garcha
_________________________________
Web Architect