If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

html is easy (just addslashes() to insert, stripslashes() when you pull it out). php is more complicated. There is a function called serialize() that will convert your php into a storable string, then you would unserialize() it when you pull it back out. But it's still just a string; so you'd have to use eval() to parse it as php code (which can be a security risk if you're dealing with user-submitted content in any way).

php code is *much* easier to store in an external file. Take whatever chunk of code you want to store and just put it in a separate file and include() it whenever you need.

As for generating the file, it sounds to me like you're trying to create a php template. For example, your template would look like:template.php

you want to input title/content/etc. into a form on a webpage
have the script generate a page, based on the template, using your info
?

do you want the page to be saved on the server (so anyone can visit it) or do you just want the page to be generated and served to you (gone after you leave)?

the answer is yes, either way. Saving the file to your server will be more complicated, you'll have to fix write permissions, etc., and I would *definitely* add security measures - otherwise, anyone could write anything they like to your website. Read up on php filesystem functions.