1
Hi, I’m trying to save the information typed in the HTML Input in txt. I already have my code that seems to be working.. But it is not creating txt. Can someone figure out why?
That’s the form, inside the body:<form name="web_form" id="web_form" method="post" action="teste.php">
<p><label>Enter name: </label><input type="text" name="name" id="name" /></p>
<p><label>Enter email: </label><input type="text" name="email" id="email" /></p>
<p><input type="submit" name=s1″ id="s1″ value="Submit"></p>
</form>
This is the PHP:
<?php
$name = $_POST['name'];
$email = $_POST['email'];
$fp = fopen("formdata.txt", "a");
$savestring = $name . "," . $email . "n";
fwrite($fp, $savestring);
fclose($fp);
?>
This may be a write permission issue in the folder. the $Fp variable is false?
– Rafael Simionato Hayashi
I’m not sure, but I believe I didn’t. I tested it on the desktop and also it wasn’t..
– Guilherme G
in my test worked perfectly
– Wees Smith