Use of PHP files

Other language: de

wiki2xhtml can edit PHP files too. They can be used e.g. for a contact form (like at http://granjow.net under “About”) or for other dymanic applications.

If you want to use PHP, you ought to have at least some basic knowledge. There are some good tutorials in the web and some good books on the market. Take a look at the Wikibook about Programming PHP. The Open Directory project dmoz has got a list of PHP Tutorials.

Integration

Using PHP files with wiki2xhtml requires only two different commands.

<!--nowiki-->
This comment can be written anywhere in the file and prevents it from being edited by wiki2xhtml.[1] It has the same effect like copying the file.
<nowiki>, </nowiki>
If PHP code isn't processed correctly, it can be enclosed with nowiki-Tags. This prevents wiki2xhtml from processing the code (and e.g. inserting wrong paragraphs …).
<!--endtop-->
For instance if you use sessions with PHP you've got to insert PHP code before the first html tag. All text written before the endtop-tag will be inserted at the top of the file—unprocessed.

Examples

To start a session[2], you have to insert following code at the top of the file: <?php session_start(); ?> <!--endtop-->

Further examples can be found in the menu under “Examples”.

Comments

  1. [↑] If angle brackets are to appear in the text, they can be escaped. Then they have no more effect. The closing angle bracket (>) should be escaped too!
  2. [↑] Session: See php.net: Sessions