I've been beating my brains out trying to figure this out. It's a form mail that can write into databases but it's CSV or comma seperated value.
I'm trying to make it so that when people enter data in text fields, it won't come out to one row with text values seperated by commas, I want each text field to be in its own column. HOW DO I DO THAT?
I've attached the php document. THANKS!!!
I think the part that deals with this is:
function save_form($vars){
global $database_file, $database_fields;
$f = fopen($database_file, 'a');
if (!$f){
die("Cannot open db file for save");
}
foreach ($vars as $k=>$v) {
$vars[$k] = str_replace(array("/", "\r","\n"), array('_',' ',' '), $v);
}
if (is_array($database_fields)) {
$vars_orig = $vars;
$vars = array();
foreach ($database_fields as $k)
$vars[$k] = $vars_orig[$k];
}
$str = join("/", $vars);
fwrite($f, $str."\n");
fclose($f);
}