Page 1 of 1

Secure page only allow those who had logged in to log in.

Posted: Mon Jun 28, 2004 7:13 pm
by fuyenhou

Code: Select all

<?php
session_start(); 
if (isset($_SESSION['logged'])) { 


<HTML>
<HEAD>
	
</head>
<body>


[b]Interface coding[/b]

</body>
</html>


} else {
[b]another error interface[/b]

}
?>
I am developing a secure page only allow member to log in...
I am wondering is this way of programming works? I don;t think works.. normally the document I read./ I found that pppl doing those interface coding by adding echo..those related information in the html code

What can I do.. if I don;t want it...

Posted: Mon Jun 28, 2004 7:19 pm
by John Cartwright
I'm sorry I didnt follow that at all.. could you rephrase what your trying to say? :P

Posted: Mon Jun 28, 2004 7:20 pm
by markl999
I prefer to do something along the lines of:

Code: Select all

<?php
session_start();
if(empty($_SESSION['loggedin'])){
    header("Location: /accessdenied.php");
    exit;
}
//secure page stuff goes here

Posted: Mon Jun 28, 2004 7:22 pm
by fuyenhou
OKie... I would like to develop a secure web site... that only allow those member who had login in order to login to the web site
For example.. http://www.hotmail.com after user login into the web site, only they can able to login into http://www.hotmail.com/home (something like that)
The page I am focus is on http://www.hotmail.com/home User are unable direct login into http://www.hotmail.com/home it is a must for them to login from http://www.hotmail.com right?
So.. http://www.hotmail.com/home is that possible to code by this way?

Posted: Mon Jun 28, 2004 7:31 pm
by John Cartwright
I agree with mark a redirect is probably the best way to go....

Posted: Mon Jun 28, 2004 7:31 pm
by fuyenhou
Yeah .. I make it thanks for help