Hi guys,
Getting fruastrated on the following problem. I was wondering how do I make it so that when the user logs in, it will go through my user.dat file and if the username and password matches, it will let them log in. If not then, re enter the information. I know that it's not secure doing it this way, but it's for a simple project. I have the following so far:
login.php
<?php
include "functions.inc";
//if the form data is clicked... if all valid.. display invoice... otherwise display error
$datafile = "users.dat";
$file = file_get_contents($datafile);
if(!strpos($file, "search string")) {
echo "";
}
if (array_key_exists('submit', $_POST))
{
if(!strpos($file, "search string")) {
echo "";
}
header('Location: registration.php');
}
else
if (array_key_exists('register', $_POST))
{
header('Location: invoice.php');
}
?>