Hi all,
I'm trying to make a simple database using a text file that gets its values from a form. I want to set up the script so that each item is separated by a comma. Then the data from each new submission from the form gets written to the next line. Here's what I have so far:
<?php
$fp = fopen("submission.txt","a");
$content = "Band Name:".$POST["band_name"]." Contact:".$POST["contact"]." Email:".$POST["email"]." Home Phone:".$POST["home_phone"]." Cell Phone:".$POST["cell_phone"]." Contact:".$POST["city"]." Contact:".$POST["state"]." Contact:".$POST["link"]." Contact:".$_POST["bio"]."\r\n";
fwrite($fp,$content);
fclose($fp);
?>
I know that this isn't right to separate the fields by commas, but I get this error when I submit from the form:
Warning: fopen("submission.txt", "a") - Permission denied in /home/httpd/vhosts/arxposure.com/httpdocs/db/submission2.php on line 2
Warning: fwrite(): supplied argument is not a valid File-Handle resource in /home/httpd/vhosts/arxposure.com/httpdocs/db/submission2.php on line 5
Warning: fclose(): supplied argument is not a valid File-Handle resource in /home/httpd/vhosts/arxposure.com/httpdocs/db/submission2.php on line 6
By the way, I have set the permissions for the directory for full read/write. Thanks very much for the help, everyone.