neridaj Posted April 16, 2008 Share Posted April 16, 2008 Hello, I have a script which uses mkdir() to generate user folders on registration, is there a similar function for file creation? I would like the script to create a redirect file for the folder generated by mkdir() upon user registration, any ideas? Thanks, Jason Quote Link to comment Share on other sites More sharing options...
jonsjava Posted April 16, 2008 Share Posted April 16, 2008 mkdir may not be the best answer. try this: <?php $folder = $username; //Whatever values you like for what $folder equals $file = $filename; //what you want the file to be $fh = fopen($folder."/".$file, 'w+'); $content = "this is the content going in the file"; fwrite($fh, $content); fclose($fh); ?> This will make the file for you, in their folder, and place the content $content in it, and close the file back up. Quote Link to comment Share on other sites More sharing options...
neridaj Posted April 17, 2008 Author Share Posted April 17, 2008 Thanks! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.