I want to create a form that accepet a user's first and second name. the form should save the first name and second name in a file. The problem is after I run it, error message said:
Warning: unable to create file storename.txt because Permission denied in /home/llama/www/PHPtesting/nameform.php on line 16
Here is my code:
<html>
<head>
<title>
</title>
</head>
<body>
<form method="post">
<input type="text" name="first">
<input type="text" name="second">
<input type="submit" value="submit">
</form>
</body>
</html>
<?php
touch("storename.txt"); //make a new file for storing names
if(empty($first)||empty($second)||empty($submit))//check user input
{print "please type your name and click";}
else
{$fp=fopen("storename.txt"); //open file
fputs($fp,$first,$second);} //input data
?>
Thanks a lot!