Making an HTML page into a php page

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
Redrock_HH
Forum Newbie
Posts: 1
Joined: Thu Dec 30, 2004 2:00 pm

Making an HTML page into a php page

Post 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?
ProfMoriarty
Forum Newbie
Posts: 7
Joined: Wed Dec 29, 2004 5:09 pm
Location: Juneau, AK

Post 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"
kettle_drum
DevNet Resident
Posts: 1150
Joined: Sun Jul 20, 2003 9:25 pm
Location: West Yorkshire, England

Post 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.
User avatar
teksys
Forum Commoner
Posts: 34
Joined: Tue May 14, 2002 6:58 pm
Location: Denmark

Post 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.
Post Reply