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?

有帮助吗?

解决方案

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top