homepage Welcome to WebmasterWorld Guest from 54.167.179.48
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
OK this is a tricky one. creating a txt file on a server.
well it is for me.
boycee

10+ Year Member



 
Msg#: 1178 posted 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.

Cheers guys
:)

 

Robber

10+ Year Member



 
Msg#: 1178 posted 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

WebmasterWorld Administrator jatar_k us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 1178 posted 8:47 pm on Sep 4, 2002 (gmt 0)

Welcome to WebmasterWorld [webmasterworld.com] boycee

Robber has it, here are the specifics.

use 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

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved