Hello, Can anyone explain to me how to prevent direct url access to a file unless the person has login. let say I have a file: ..../client.php, I want user to login first before accessing this page.
Assuming you're using apache, you can use htaccess to do this for you. Failing that, you could create a php login script - however, that wont help when the files not a php file!
If you use php, and use sessions, you can use this: if(!isset($_SESSION['id']))header('Location: index.php') PHP: If you don't have to much knowledge about php, you can better use htaccess protection.
Hello, I just try to use htaccess by typing: Deny from all. But the problem is that it deny access even if a user register and use the login form. I guess I need to write a different code but I don't really know what. The page I want to protect is name client.php