Hello, sorry to bother you all but, i do need some help since im totally new with php, what im trying to do here is to make two fields to be save in a file (they actually do) but when i type some rows are getting at the same row as a previous post, can some one please look up this script for me? Thanks in advance.
index.php:
<form name="form1" method="post" action="index2.php?saving=1">
Text1: <br><input type="text" name="username"><br>
Text2:<br>
<textarea name="password" cols="100" rows="10"/>
</textarea>
<br>
<input type="submit" value="Save">
</form>
<p>
index2.php:
<?php
$username = $_POST['username'];
$password = $_POST['password'];
$fp = fopen("myfile.txt","a+") or exit("unable to open the file");
if($fp != null)
{
fwrite($fp,$username);
fwrite($fp,$password);
}
fclose($fp);
?>