I want to write text to the bottom of an existing text file but don't have a clue how to do it.
I have tried the code below but it don't work.
The text file location is C:\inetpub\wwwroot\test.txt
<?php
if(isset($_POST['submit'])){
$email = $_POST['email'];
$file = fopen("C:\inetpub\wwwroot\test.txt\\","a+");
fwrite($file,$email);
fclose($file);
print_r(error_get_last());
}
?>
<form action= "" method="post" name="form">
<input type="text" name="email">
<br>
<br>
<input type="submit" name="submit" value="submit"><br>
</form>
What am I doing wrong?
/). The ones at the end look wrong too, as Kyle says.