Another Question

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
mcraft59
Forum Newbie
Posts: 7
Joined: Wed Jul 09, 2003 6:18 pm
Location: Columbus

Another Question

Post by mcraft59 »

Okay got my php scripts working sorta... What I am trying to do now is output to a text file(http://www.mcraft59.com/forma.html).
My current code for my script is:

<?php
$input=fopen("try.txt", "a");
fwrite($input, $name);
fwrite($input, $color);
fclose($input);
?>

Unfortunately, my text file remains empty. I checked file permissions and it has user write enabled.

I checked my form to make sure it was capturing variables correctly: http://www.mcraft59.com/simple.html , it just displays my data through the echo command.
qartis
Forum Contributor
Posts: 271
Joined: Sat Dec 14, 2002 4:43 pm
Location: BC, Canada
Contact:

Post by qartis »

What OS is the server running? PHP often needs more flags in Windows.
macewan
Forum Commoner
Posts: 97
Joined: Mon Jul 07, 2003 8:27 pm

Post by macewan »

that's a linux box
qartis
Forum Contributor
Posts: 271
Joined: Sat Dec 14, 2002 4:43 pm
Location: BC, Canada
Contact:

Post by qartis »

Are you sure that the user/group apache is running as has write access to the file? Just chmod it to 777 for the text, and see if it works.
Post Reply