Page 1 of 1

creating new pages

Posted: Thu Feb 22, 2007 1:27 am
by Mad0Driver
Hey everyone, i want to set up a "program" that can set up multiple pages for me. Basically for my page i need to have "tests". They are simple enough to create, but if i need to set up multiple "tests" it could take undue amounts of time. So what i want is two have a page that asks certain questions, and those questions will be posted in a certain order on a new page. But i need the program to set a new page on my website, so it actually adds pages to my directory as if i had used my WYSIWYG editor. Any ideas?

Thanks

Posted: Thu Feb 22, 2007 2:16 am
by feyd
Code generation can be a bad smell.. but it's your project. :)

fopen() + fwrite() + fclose(), file_put_contents() may all be of use/interest.

Posted: Thu Feb 22, 2007 1:54 pm
by Mad0Driver
What do you mean can be a bad smell? IT doesnt always work?

And whis will only work if i create a blank page on my site, right?

Thanks

Posted: Thu Feb 22, 2007 2:15 pm
by shiznatix
basically what you are going to do it auto-generate php code, then write that code (which is actually a string) to a file. This can get really hairy because you are auto-generating code and things can go wrong really fast.

Just have the code of the test page in a string, create a file with fopen() then write the string to the file and there you go!

Posted: Thu Feb 22, 2007 11:34 pm
by nwp
If There is an error in your php codes and you didn't looked at it while testing
all ther visitors will face that particullar error in a Chain
and then you need to recreate all the wrong pages
so i think its a very bad idea
-----------------------------------------------------------------------
But if you think to generate the page in the fly and then delete it after compiling
then its a matter with lower risk than it was of before
but in this casa don't forget to use a .htaccess in it to make the Access Denied(Deny from All)