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 Link to comment https://forums.phpfreaks.com/topic/101423-solved-automating-redirect-file-creation/ 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. Link to comment https://forums.phpfreaks.com/topic/101423-solved-automating-redirect-file-creation/#findComment-518786 Share on other sites More sharing options...
neridaj Posted April 17, 2008 Author Share Posted April 17, 2008 Thanks! Link to comment https://forums.phpfreaks.com/topic/101423-solved-automating-redirect-file-creation/#findComment-519118 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.