/ Published in: PHP
2 login functions that check if a user is logged in by checking is a session is equal to true that would have been set on login.
If not logged in the redirect to login.php
If not logged in the redirect to login.php
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function logged_in() { if($_SESSION['authorized'] == true) { return true; } else { return false; } } function login_required() { if(logged_in()) { return true; } else { } }