javascript - Validate a link to check a user login are not -


in website clicking link, if user login in website ,the page redirects page otherwise redirects login page how can validate page .can u give solution that.

you can done session. more detail session : link

<?php   if(isset($_session['login'])) {       header ("location:dashboard.php");   }   else   {     header ("location: login.php");   } ?> 

in check if session set user login redirect dashboard.php or if session not set redirect login.php page.

in login page set session $_session['login'] 1 or 0 value. or can store username .


Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

sql - Duplicate Column name error while executing mysql query? -