php - Prevent access to login page -


how can prevent access login page logged in users. want redirect them homepage if access login page (when logged in), www.example.com/login.php.

if maintaining session users simple on login page add code on top of page :

<?php  session_start();   if(isset($_session['user_data'])) { //redirect desire page: header("location:home.php");  }  ?> 

in above code considering have creating session variable after successful login.


Comments

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

How to get multiresult with multicondition in Sql Server -