Welcome to WebmasterWorld Guest from 184.108.40.206 , register , free tools , login , search , subscribe , help , library , announcements , recent posts , open posts Subscribe and Support WebmasterWorld
OK this is a tricky one. creating a txt file on a server. well it is for me. boycee msg:1259316 8:15 pm on Sep 4, 2002 (gmt 0) Ok i need to have a form that makes a txt file on the server.
i am a huge php n00b, i'd imagine making a database would be more efficient but i dont have a clue where to start on that one.
So is there anything i can add to a form to make a file on the forms contents on my server, i imagine i would have to set a directory 777 as well, but thats no probs.
Robber msg:1259317 8:39 pm on Sep 4, 2002 (gmt 0)
Welcome to the boards Boycee.
Not really done much php yet, but if its like Perl (which I think it is), just take your form input, use an open function to open a file for writing (or appending depending on your requirements), print the form contents to the filehandle and that should be it. If the file didnt previously exist, one should be created when you use the open function.
Someone else can probably help with more specifics.
jatar_k msg:1259318 8:47 pm on Sep 4, 2002 (gmt 0)
Welcome to WebmasterWorld [ webmasterworld.com] boycee
Robber has it, here are the specifics.
fopen [ php.net] also look at fwirte and fclose in there.
I would do
$filepointer = fopen('fullpath','a+'); means - set filepointer to the file specified in fullpath and open it for appending, if it does not exist, create it