0

First off, I would like to apologize if this is an amateur question, I am a student, and there is barely any tutoring available to me for these simple questions.

EDIT: My issue was the microsoft notepad, as it is a linux server they can't agree on how to show the file. opening in notepad++ solves this!

I am trying to make a database in a text file currently. I know MySQL would make my life a million times easier at doing this, however I am required to use a text file.

What I am trying to do, is take a last name, first name, and an email and output it to one line of a text file, with the next entry on the following line.

Here is what I have been doing so far, which will only write directly after the previous entry.

When I put "\n" concatenated at the end of my fwrite command e.g.

fwrite($openFile, $custInfoFormat. "\n");

this will not work either.

What am I doing wrong? Again, sorry if this is a dumb question.

if (!empty($guestFname) and !empty($guestLname) and !empty($guestEmail)) {
echo "DEBUG1 ALL BOXES HAVE CONTENT<br>";
$custInfoFormat = $currTime. ": ". $guestLname. ", ". $guestFname. ", ". $guestEmail. "|". "\n";
$openFile = fopen($outputFile, "a+");
fwrite($openFile, $custInfoFormat);
fclose($outputFile);
Bryant L
  • 21
  • 4

0 Answers0