Warning: fopen(/home/content/k/s/r/ksrhostadmin/html\login\passwords.txt): failed to open stream: No such file or directory in /home/content/k/s/r/ksrhostadmin/html/login/engine.php on line 13
Warning: feof(): supplied argument is not a valid stream resource in /home/content/k/s/r/ksrhostadminhtml/login/engine.php on line 16
Warning: fgets(): supplied argument is not a valid stream resource in /home/content/k/s/r/ksrhostadmin/html/login/engine.php on line 20
<?php
session_start();
session_register("GoBack_session");
// Connects and opens the text file
// DATA FORMAT IN TEXT FILE= "username<SPACE>password"
// $MyFileObject is of type "Scripting.FileSystemObject"
$MyTextFile=fopen($DOCUMENT_ROOT."\\login"."\\passwords.txt","r");
// Scan the text file to determine if the user is legal
while(!feof($MyTextFile))
{
// If username and password found
if (fgets($MyTextFile)==$_POST["username"]." ".$_POST["password"])
{
// Close the text file
fclose($MyTextFile);
// Go to login success page
$_SESSION['GoBack']=$_SERVER["SCRIPT_NAME"];
header("Location: "."/login/download.php");
exit();
}
}
// Close the text file
fclose($MyTextFile);
// Go to error page if login unsuccessful
$_SESSION['GoBack']=$_SERVER["SCRIPT_NAME"];
header("Location: "."/signup.php");
exit();
?>