I’m using a PHP script for a simple registration form where when you enter your information and click submit, it sends the data to a .csv file rather than a database.
Originally the script was a Beta splash page with only email and name fields but I have since added a question of ‘Are you able to attend?’ with a ‘Yes’ or ‘No’ radio button as an option.
I’ve tested the form and it kind of works. The data is sent to the .csv file with a new column for the ‘Are you able to attend?’ question but no matter what you put (either ‘Yes’ or ‘No’) the .csv file always shows ‘Yes’ as the submitted data from the form.
Quite a lot of code, but here’s the code for the index.php page: http://pastebin.com/XLy62q7A and here’s the code for the submit.php page: http://pastebin.com/XvYCFSwY
I’ve named the question in the PHP ‘attendance’ so whereever you see attendance should apply.
<?php
$file = 'data.csv';
$name = $_REQUEST['name'];
$attendance = $_REQUEST['attendance'];
$email = $_REQUEST['email'];
$additional = array($attendance,$name,$email);
Many Thanks. Also willing to offer a bounty for a solution.
try this