I’m trying to set up a RSVP form which will take form data and write it to a simple text file on the dreamhost server. I am submitting this form to a PHP script. Right now a simple test code looks like:
$myFile = fopen(‘rsvp_data.txt’,‘w’);
fwrite($myFile,‘This is a test\n’);
rsvp_data.txt already exists on the server, but I can not get the form to write to the file. I’ve tried changing the permissions on it to all sorts of combinations, and it won’t write. However, if I log in to the server through SSH, and run the script though the command line “php -f”, the file gets written to. Anyone know what I’m doing wrong?
I’m new to PHP, but have used CGI, perl, and a variety of other languages before. I’m using the DreamHost shared solution, if that matters.