I have a part on the website where a user enters their email. I am trying to make it log the email onto a text file, but for some reason it is not logging at all. I have tried many different PHP codes, and they all do not work.
My HTML action is being directed at the php file, I don't know what the problem is, and It's pretty annoying.
Here is an example of the code I am using :
Code: Select all
function doLog($text)
{
$filename = "smileback.txt";
$fh = fopen($filename, "a") or die("Could not open log file.");
fwrite($fh, date("d-m-Y, H:i")." - $text\n") or die("Could not write file!");
fclose($fh);
}