hello all,
I am trying to save my form data to a local text file. but, seems like my php code is a bit wrong.i am not able to make it out.please help
my html:
<form method="post" action="Input1.php" name="form">
<label> New Data set: </label>
<input type="radio" name="url" value="NetOptInput2.html" id="ex1" required/> Yes
<input type="radio" name="url" value="NetOptResult2.html" id="ex2" required/> No
<br><br><br>
<label>Dataset description:
</label>
<input type="text" name= "Dataset" id="field1" size="30" placeholder="" readonly><br><br><br>
<label>Token Number : </label><input type="text" name="Token Number" id="field2" size="6" placeholder="" readonly><br><br><br>
<div style="text-align: center"><br>
<input type="Submit" name="submit" value="Submit" class="submit">
<div class="spacer"></div>
</form>
my php:
<?php
if (isset($_POST['submit'])) {
file_put_contents('C:\Users\ra\Desktop\input.txt', $_POST['Dataset'], FILE_APPEND | LOCK_EX);
file_put_contents('C:\Users\ra\Desktop\input.txt', $_POST['Token Number'], FILE_APPEND | LOCK_EX);
};
error_reporting(E_ALL);
?>