saving csv files from a php form

Hi I’m a real novice but I have generated a php form that is an application form for a volunteer organization. The form is pretty long but it works fine and saves the csv file in a folder called applications

//saving record in a text file
$pfw_file_name = “…/application/gal app.csv”;

The problem is that the name gal app.csv gets over written every time a new application is submitted. What I want to do is save the form using the applicants name. Here is part of the code which captures the name

// Receiving variables
@$Real_name = addslashes($_POST[‘Real_name’]);
@$Address = addslashes($_POST[‘Address’]);

Any help would be appreciated

Paul

You can have your file name to be generated like this:
[php]
$pfw_file_name = “…/application/”.preg_replace("~[^a-zA-Z0-9-’]~","_",$_POST[‘Real_name’]).".csv";
[/php]

Thank you that works perfectly

Paul

Sponsor our Newsletter | Privacy Policy | Terms of Service