View Full Version : php in dreamweaver

11-14-2011, 09:49 PM
I am new to both dreamweaver and PHP. I am creating my first website and I would like to put a PHP code to retreive the day and date. I have already started creating my webpage and want to add this now. I saw at the beginning that I could create a new PHP page but I was wondering if I can insert a php line into my HTML code and if so, how would I do that?

11-14-2011, 11:35 PM
You can insert php code into an existing page just place it inside php tags.

<?php code goes here ?>

However most server set ups require that pages containing php code use the .php file extension. So, if your existing pages use .html you'll need to change them or use this code in your .htaccess file to allow php in html.

AddType application/x-httpd-php .html