if you use the code i posted above, it should work. however, you might want to add some error checking in there. you could check if the file can be written (sometimes you can open it for writing, but you can't write in it), if user's input is valid, etc.
also the first script has a hardcoded parameter $file. you probably want to pass that parameter to the script from the outside somehow.
__________________ RouTHost.com
PHP MySQL Perl SSI e-commerce
plans start at $3.95!
1. what would happen if the file was already there? would it overwrite it?
2. how would i make it so it had lots of uneditable code, then the content of an input box (e.g a color), then more code, then another input and so on....