Hi all.
A client I'm doing a site for wants a login page, where the username and password are coming from a text file and not a database. Each username also has a corresponding URL that I need to have show up on the page once the person is logged in.
Here is a piece of code that I found that reads in the username and password, but not the URL. I understand parts of it, but I'm not quite sure how to add the URL variable into the array.
Any help would be greatly appreciated!
Amber
<?php
$logok = FALSE;
if (isset($login) and isset($passwd)){
$fp = fopen("password.txt", "r");
while (feof($fp) == 0)
{
$line = chop(fgets($fp,1000));
$arr = split(",", $line);
if (($arr[0] == $login) and ($arr[1] == $passwd))
{
$logok = TRUE;
continue;
}
}
}
if (!$logok)
{
?>
If the login is OK, open a file
<?php
if ($logok)
{
?>
<script language=JavaScript>
window.location.href="your_next_file.php";
</script>
<?php
}
?>