Blueblazer172 Blueblazer172 - 1 month ago 8
PHP Question

Multiple User Section [more than one page]

I'm starting a session and redirect after successful login to a home.php



now my question is how can i let access the users more pages. i thought about:

<?php

session_start();

if(isset($_SESSION['user_session'])!="")
{
header("Location: home.php");
header("Location: home2.php")
}

?>


this page should only useable to the users.

First the user should be redirected to home.php and then the user should get access to another page like home2.php but a non-user shouldn't get access to this page.


When the user is at home.php i thought about a simple
<a></a>
redirect with html to home2.php

Answer

Create a session and make an <a></a> Tag that only registered useres can see. You have to session_start() in every site and Theo redirect if the User is already logged in