PHP Code

The PHP Code component allows to include PHP code directly into the website.

This is useful for example to extend the website with more features, like guestbooks, blogs, and similar. Note: You need to run your website on a web server which supports PHP in order to make this work. Also, you should ensure that the file name extension of the web page which includes a PHP code element usually should end with '.php' instead of '.html', so you might want to rename your page for that.


There is a detailed tutorial showing how to use the PHP code element.


Properties

This component supports several background modes (Color, Image, Gradient), changeable by selecting the property 'BackgroundMode'. It also supports several border modes. These are only available when the checkbox 'CreateDivAroundCode' is checked.


By double-clicking the element or by selecting the button '...' on the 'Code' entry in the property window, you can directly enter the PHP code.



Alternative: Inline PHP Code

You don't need to use that PHP Code element. As alternative, you can place also very easily inline PHP code at any place, if you have the professional edition of RocketCake.

You only need to enclose it in the PHP tags "<?PHP" and "?>". For example just write something like


<?PHP echo ('hello world'); ?>


And RocketCake will add this code at the place where you typed it. This will only work if the name of the generated webpage has the extension .php. And it will only run if started from a webserver with PHP support.


Copyright © by Ambiera e.U.