PDA

View Full Version : I can see my PHP script when I view source



thane_rm
09-09-2006, 05:59 PM
in the browser. Why am I able to see my PHP script when I view source code in the browser? I thought that the server was supposed to translate it and display it. You can see a test I was running at www.watermarkstudios.com/_index.html (http://www.watermarkstudios.com/_index.html) . If you view source you can see my PHP script.

Why is it doing that?!!

Ken

navaldesign
09-09-2006, 10:35 PM
Because the page has been saved and published as html. You need to publish it as .php for the server to understand that it contains php code and treat it as such. As it is now, it treats it as html.

econstas
09-14-2006, 08:57 AM
1 way - just name it direct when saving page as
2ne way: when you ahve the page.. right click => page properties. In the middle you will see file extension: html.. that scroll down will also have php option. While you are there, you can name your page. The Title of the page. This will change the name at the top of the page.

aclips
11-07-2006, 09:49 PM
You can always create a .htacess file in your webpage main folder with the folowing line

AddHandler application/x-httpd-php .php .php3 .phtml .html .htm .php4

This will intrepertate the php code in the html code