By default, Joomla does not support PHP in editing the content page. DirectPHP helps you to embed your PHP code in Joomla. It supports both Joomla 1.0.x and Joomla 1.5.x
Install DirectPHP in Joomla 1.0.x
1. Download the DirectPHP plugin and unzip the archive.
2. Go to Joomla Adminsitration -> Installers -> Mambots.
5. DirectPHP blocks some PHP commands such as fopen, fwrite … etc. You can disable the blocking by editing the DirectPHP Mambots.
6. Try the PHP code in the content page.
* This plugin works well with TinyMCE WYSIWYG Editor and NO WYSIWYG Editor. Please refer to Joomla – Adding Paypal Website Payment Standard Button for modifying the Joomla text editor
You can find more details about the installation and usage at php-gtk2 Cookbook – DirectPHP plugin.