Hello,
This is a question regarding user authorization.
I've set of files in my directory and i want to put up a log in screen to enter the user name and password to view any files in the working directory.well, i made it so!
Index.php is my screen for log-in details.
when the user is logged in successfully,main.php will be shown.Now, my question is, when the user tries to view main.php or any other php files in my directory,it should pop up my log-in screen that is index.php.How can i do this?
This is the code which i used for index.php.
<?php
$myuser = "admin";
$mypass = "pass";
if ($user == $myuser && $pass == $mypass)
{
header ('location: main.php');
}
else
{
echo"<form action=\"$PHP_SELF\" method=\"POST\">\n";
}
?>
-----Here follows my HTML code for screen display------------------------------------
Thank you