Save form script. Problem
I am a beginner and building a form processor script that is intended to make a backup of the submitted form, in html format. I might be using the wrong technique, but here is a simple setup of my processor script (writeform.php). My problem is the checkboxes...how can I reproduce a checked checkbox within the $stringData, which depends on if the submitted checkbox is checked?
<?php
$file = fopen("formsaved.html", "w") or exit("Unable to open file!");
$stringData =
'<head>
</head>
<form id="form1" name="form1" method="post" action="writeform.php">
<input type="text" name="1" id="1" value="'.$_POST['1'].'"/>
<br />
<input type="text" name="2" id="2"/>
<br />
<input type="checkbox" name="check" id="check" />
<br />
<input type="submit" name="button" id="button" value="Save" />
</form>
<body>
</html>
'
;
fwrite($file, $stringData);
fclose($file);
?>