I have a very simple one input form (in PHP) that I would like to modify. It saves the data input into the form text box in a text file.
I need it to open the text file first, check if the entry is already in the text file, if it is it will just display a message saying "Already Added" or if the entry is not in the text file, it writes to the text file then displays a message "Added"...
Here is the code and HTML...
$email = $_POST['email'] . PHP_EOL;
$file = fopen("[url removed, login to view]","a+");
<form action= "" method="post" name="form">
<input type="text" name="email">
<input type="submit" name="submit" value="submit"><br>
As you can see this is very simple. it currently opens the text file, writes the email address, done. It should open the text file, read it and then write if the entry does not already exist...
This is a very simple project using file_get_contents() and then use strstr() to see if $_POST['email'] is in the contents you read. Only if it isn't, then open and write the email address to the file.
Please bid according to needs, maybe 3 minutes of work.
19 freelancers are bidding on average $22 for this job
Hello Sir, How are you doing? I went through your requirement is validation on text file records and Yes I can do. I will be available to discuss in detail Thank you Rajesh Kumar
. Relevant Skills and Experience i have good knowlede i have good team and i can do it [login to view URL] we all are degree holders .i can send my team [login to view URL] select our [login to view URL] Proposed Milestones $33 USD - . .