quote:
Originally posted by Shadow
Hello everyone, i have made a page in HTML that actually needs to be coded in php, is there a way to easily convert the code??
Rename the Page to end in ".php". When it's requested by a browser, it'll come out exactly the same (unless there are PHP start marks ("
<?php" or "
<?" with short tags enabled in PHP) in the page code).
You can add bits of PHP where they need to go into the existing code.
This post looks long, but it's simple and only looks long because there's lots of space. Have a read of the examples below.
awesome.html:
code:
<html>
<body>
The date is 2006-11-30. It is a Thursday.
</body>
</html>
gives:
quote:
The date is 2006-11-30. It is a Thursday.
awesome.php:
code:
<html>
<body>
The date is 2006-11-30. It is a Thursday.
</body>
</html>
gives:
quote:
The date is 2006-11-30. It is a Thursday.
awesomer.php
code:
<html>
<body>
The date is <?php date(Y-m-d) ?>. It is a <?php date(l) ?>.
</body>
</html>
gives:
quote:
The date is <the date now>. It is a <whatever day today is>.