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?

Était-ce utile?

La 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.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top