I have made a form and want to get values in form.php when Submit button is clicked.These values are write on a file form.txt.How can I do this??
<html>
<form action="form.php" method="post">
Name:<input type="text" name="Name" ><br/>
Address:<input type="text" name="Address"><br/>
Email:<input type="text" name="Email"><br/>
Why do you want to learn Javascript?
<input type="radio"> Do not know<br/>
<input type="radio"> Because my boss told me to <br/>
<input type="radio"> Generally interested <br/>
<input type="radio"> It might come in useful <br/>
How did you get to this site?
<select>
<option> I found it by accident </option><br/>
<option> Through WDF </option><br/>
<option> Through ABC </option><br/>
<option> Through a search engine </option><br/>
</select>
I'd like additional information about<br/>
<input type="Checkbox"> C++<br/>
<input type="Checkbox"> Visual Basic<br/>
<input type="Checkbox"> HTML <br/>
<input type="Checkbox"> CSS<br/>
<textarea cols="10" rows="20" name="mytextarea">
</textarea>
<input type="button" value="Submit">
</form>
</body>
</html>
Here is the form.php.What is the mistake in it and how can I correct it?
<?php
$file = 'form.txt';
$fh = fopen($file, 'w') or die("Can't open file");
fwrite($fh, $Name);
fwrite($fh, $Address);
fwrite($fh, $Email);
fclose($fh);
?>