im makeing a lttle online office space and i made the page from scratch but i want to enkrypt the entire page with a pass so when ever the adress is hit in browser you have to type a pass. i dont know how to do this?
There are several ways password proted your page, however this is one of the easier: <?php $myusername = "myusername"; $mypassword = "mypassword"; $areaname = "Authorization Required"; if ($_SERVER["PHP_AUTH_USER"] == "" || $_SERVER["PHP_AUTH_PW"] == "" || $_SERVER["PHP_AUTH_USER"] != $myusername || $_SERVER["PHP_AUTH_PW"] != $mypassword) { header("HTTP/1.0 401 Unauthorized"); header("WWW-Authenticate: Basic realm=\"$areaname\""); echo "<h1>Authorization Required.</h1>"; die(); } ?> Code (markup): However if you need additional encryption, have a look at this post: http://forums.digitalpoint.com/showthread.php?t=137579 Code (markup):
See Authentication, Authorization and Access Control for the server based methods. That will control access, but will not encrypt. If you want encryption, you will need to go with a secure socket layer or a non-http method. cheers, gary