Hi
I am writing to a text file but end up having several duplicates in the text file, this is a basic program I am creating using PHP and HTML.
How is it possible to fwrite only when record exists. Thnx
<?php
$FirstName = $_POST['FirstName'];
$LastName = $_POST['LastName'];
$Email = $_POST['Email'];
$content= $FirstName."|".$LastName."|".$Email."\r\n";
$fp = fopen("member.txt","a");
if(!$fp)
{
echo 'Error: Cannot open file.';
exit;
}
fwrite($fp,$content);
{
echo ("Hello, ".$_POST['FirstName']." ".$_POST['LastName']." to ICANS Members page.");
}
fclose($fp);
?>