Page 1 of 1

Automating redirect file creation

Posted: Wed Apr 16, 2008 1:56 pm
by neridaj
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

Re: Automating redirect file creation

Posted: Wed Apr 16, 2008 2:13 pm
by flying_circus
Sure, use fopen() and fwrite().

fopen() creates the file and opens it as a resource

fwrite() will write a string (file contents) to a resource (the one created with fopen())

The example given for fwrite() is pretty straight forward and shows usage of fopen and fwrite

http://us2.php.net/manual/en/function.fwrite.php