Welcome to WebmasterWorld Guest from 126.96.36.199 , register , free tools , login , search , pro membership , help , library , announcements , recent posts , open posts Pubcon Platinum Sponsor 2014
OK this is a tricky one. creating a txt file on a server. well it is for me. boycee
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.
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.
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