This topic is locked

password protected

3/2/2009 1:05:44 PM
PHPRunner General questions
C
clifford author

Hi everyone
I hope someone can help me with this. I have created a login page and I am going to add several html pages to my site how can I password protect these pages.
Your help is apprishiated.

Sergey Kornilov admin 3/2/2009

It won't help you to protect HTML files. You need to rename files to .php and add the following code snippet in the beginning of each file.

<?php
if(!@$_SESSION["UserID"] )

{

$_SESSION["MyURL"]=$_SERVER["SCRIPT_NAME"]."?".$_SERVER["QUERY_STRING"];

header("Location: login.php?message=expired");

return;

}
?>