I have a HTML code that opens a simple web form where a user can nominate another member of staff to be entered into a prize draw, which is working lovely…
My question is that I’m trying to create a PHP script that will write a csv of all the data that is entered, so we can then export this into Excel.
So far I have “data.csv” and “write_to_csv.php” in the same folder, can anyone have a look at my code and see where I’m going wrong?
[code]
<?php // Contact From $fromstaff = $_POST['from']; // Contact Student Name $staffname = $_POST['staffname']; // Contact Issue $reason = $_POST['reason']; //Mail To $to = '[email protected]'; //Mail Subject $subject = 'Give Thanks'; //Mail Message $message = "GiveThanks Form
From
$fromstaff
Staff Name
$staffname
Reason
$reason