Hi, I would like to make one of my pages in my site only visible after the user has logged on, as at the minute you could just go to the URL and the page would be displayed, how can I stop this and only make it visible after logon?
Making a page only visible after logon
Started by Alex_j, Mar 17 2010 08:20 AM
2 replies to this topic
#1
Posted 17 March 2010 - 08:20 AM
|
|
|
#2
Guest_Jaan_*
Posted 17 March 2010 - 08:25 AM
Guest_Jaan_*
http://forum.codecal...off-system.html
Use this tutorial to create a registration / login forms.. then user can log in to view the content.
Use this tutorial to create a registration / login forms.. then user can log in to view the content.
#3
Posted 17 March 2010 - 12:09 PM
You just have to simple, set a Session variable.
like this:
when u login set this variable:
then test on the others sites like this:
remember to set the session_start();
before using session variables
Good luck, Flezria
like this:
when u login set this variable:
$_SESSION['login'] = "yes";'
then test on the others sites like this:
if($_SESSION['login'] == yes) {
include "Yoursite.php";
}else {
echo "You arent logged in!!";
}
remember to set the session_start();
before using session variables
Good luck, Flezria


Sign In
Create Account


Back to top









