I'm having some trouble getting my script to save a file in a particular folder, normally the syntax would call for quotes around the entire path but because I'm using $_POST to name the file it just doesn't work out that way. So far this is what I have.
<?php ini_set('display_errors','on'); ?><?php
$fileName= fopen("Submissions/".$_POST['first_name'],'w');
$data= "";
foreach ($_POST as $key => $value) {
$data.= str_replace("_"," ",$key).":
". $value."
"; preg_replace("/[^ 0-9a-zA-Z]/", "_", $value);
}
fwrite($fileName, $data);
fclose($fileName);
?>