I'm creating a website for learning purposes only. I have made it so in the index.php is a basic login form. It is setup with MySQL. I want to make it so when you are not logged in you see the form website in index.php, and when you are logged in you see an entire different site in index.php as well. I know how to check if i am logged in or not, so the basic question is: can i do something like this type of style:
if(loggedIn){
include 'loggedInSite.php';
}else{
include 'notLoggedInSite.php';
}
Or does it have to be totally different? Or should I do something along these lines:
if(loggedIn){
echo "<html>Whole site</html>";
}
Echoing out the entire website in a simple echo function?
Your first example should work just fine with a slight alteration:
if($loggedIn){
include 'loggedInSite.php';
}else{
include 'notLoggedInSite.php';
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With