Question

I am developing a web application and i am using apache server to deploy it! I want stop going to particular web page directly when i type in the url on my local server as that page should always appear after a successful Log-in. What is the approach that i've to consider?

Was it helpful?

Solution

as per reference to comment i am writing code.

in login page if login successfully.

<?php
   session_start();
   $_SESSION['uname']="XYZ";
?>

below Page that open after successfully login.

<?php
  session_start();
   if(!isset($_SESSION['uname']))
       //redirect to login page here 

?>

here if the session variable not set that it transferred to login page again. means page can't access without login.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top