This question already has an answer here:
im getting following error at a simple php form with multiple checkboxes which should save the checkbox infos to CSV as a comma separated string or smthg like that: "Parse error: syntax error, unexpected T_STRING" Hope someone can help, im new in php.
HTML Form:
<label>
<input type="checkbox" name="chk_group[]" value="value1">
Value1</label>
<br>
<label>
<input type="checkbox" name="chk_group[]" value="value2">
Value2</label>
<br>
<label>
<input type="checkbox" name="chk_group[]" value="value3">
Value3
</label>
PHP Code:
<?php
$dz=fopen("x.csv","a");
if(!$dz)
{
echo "File could not open.";
exit;
}
fputs($dz,$_POST["Name"].";"
implode(',',$_POST['chk_group']).";"
.$_POST["month"].";"
.$_POST["month2"].";"
.$_POST["textarea"].";\n");
echo "Sent.";
fclose($dz);`
?>
Aucun commentaire:
Enregistrer un commentaire