I have a form in which I want to capture the name and email of a user and store it in a text file. I'm not sure if it's my code or if I have to save my script in a specific place. When the submit button is clicked I get an error that says "404 file or directory not found". My client is uploading them through ftp so I have no way to check if it works locally. The PHP script(process-form-data.php) and text file (formdata.txt) are saved within the public HTML folder. I'm very new to PHP so sorry if this is a dumb question. Any help on what I'm doing wrong and the process of uploading the files would be greatly appreciated, thanks!
<form name=”web_form” id=”web_form” method=”post” action=”process-
form-data.php”>
<label for="exampleInputEmail1"><h3 style="color: #eee; margin: 0;
font-weight: 400;">Request Information</h3></label>
<input type="text" name=”name” class="form-control" id="name"
placeholder="Your Name">
<input type="text" class="form-control" name=”email” id=”email”
placeholder="youremail@domain.com">
<button type="submit" name=”s1″ id=”s1″ value="submit" class="btn
btn-primary btn2">Submit</button>
</form>
<?php
$name = $_POST[‘name’];
$email = $_POST[’email’];
$fp = fopen(”formdata.txt”, “a”);
$savestring = $name . “,” . $email . “n”;
fwrite($fp, $savestring);
fclose($fp);
echo “<h1>You data has been saved in a text file!</h1>”;
?>