Page 1 of 1

Making an HTML page into a php page

Posted: Thu Dec 30, 2004 2:04 pm
by Redrock_HH
Hiya all ... Here is prolly a simple question .... I done have a completely designed site but i need for my main page to be index.php it is already written in HTML ... how can i change the html page into a working php page?

Posted: Thu Dec 30, 2004 2:58 pm
by ProfMoriarty

Code: Select all

<?php

echo " allyourhtml ";

?>
Make sure that any quotation marks in your HTML are preceded by a "\" so they don't prematurely interrupt the echo statement. Good luck.

EDIT: Also, make sure your document is called "index.php", not "index.html"

Posted: Thu Dec 30, 2004 4:03 pm
by kettle_drum
Or you can just rename it index.php

And then only use <?php ?> where you need to display something that requires you to use php.

Posted: Sun Jan 02, 2005 11:02 am
by teksys
You can also add this line in your Apache configuration:

Code: Select all

AddType application/x-httpd-php .html
That way you can use PHP in your HTML pages.