문제

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