I’m new to the whole web page design thing. i’m trying to make a very simple script thats writes only unique entries to a txt file but i dont know how th disallow duplicates. i need to know how to do that. i would like the script as small and simple as possible and security is no issue as the data is not vital. also i need a script that redirects to a random page chosen from a line on a text file in a frame with an menu to change the delay time without repeating and pages. the second request i haven’t started on yet so i might be able to figure that out. in its entirety i dont want the script using anything but html, php, and js. no databases. heres what i got so far.
in folder “usrs”
“index.htm”
“usr.php”
“usr.txt”
usrs/index.htm
User: ================================================================= usrs/usr.php ------------------------------------------------------------------------------------------- <?PHPheader(“refresh: 3; url=http://localhost/usrs”);
$usrs = “usr.txt”;
$input = $_POST[‘usr’];
$usrp = fopen ($usrs, “a+”);
if ($usrp) {
fwrite ($usrp, “$inputrn”);
fclose ($usrp);
echo (“Database updated
Thank you for the submission.”);
}
else {
echo (“An error occurred and database was not updated”);
}
?>
usrs/usr.txt (examples only)
012345
123456
234567
The script works but i do not know how to disallow duplicate entries