[Phpwm] How to create a page on a server from a browser

Phil Beynon phil at infolinkelectronics.co.uk
Mon May 1 22:25:20 BST 2006

> Hi all,
> I am developing a web based application where I can create files on the
> server via the web browser. So that users can create and edit
> .html files. I
> will have a text box on the web page which will be used to name the page
> (e.g. about.html) and a submit button. When the submit button is
> clicked, a
> page (about.html) will be created on the web server (apache).
> Any ideas how to do that using PHP?
> Thanks,
> Ray

Hi Ray,
One thing to point out here that you may not have considered, if you are
using a multi line text box for entry is that you will also need to replace
any embedded control characters generated by the user's input into the text
box to the correct HTML codes. For instance a line return will need to be
altered from \n to a <br> tag.
There are quite a few other bits you need to look at replacing as well, most
notably quotes as these will cause some 'interesting' things to happen if
you try and store the page in a database record.
You can use ereg_replace to do this; $myvariable =

If you are later allowing the user to edit their input you will need to
change all these bits back as a text field will not interpret things such as
html entities and will display the &hash codes for them.

If you are going to give them a view before publish type page then you will
need to work out a method of suppressing the page head information and just
give the content data.


Phil Beynon
Sales director

** http://www.diygear.com THE Online DIY Toolstore For DIY & Business
** Infolink Electronic Systems Ltd. http://www.infolinkelectronics.co.uk
** Professional Web Design & Cobalt Hosting Solutions
** Contact: Sales at infolinkelectronics.co.uk
** Tel / Fax 0121 458 4894 (office) 0121 441 3558 (home) 07801 548464

More information about the Phpwm mailing list