Is there an easy way to convert simple html code to php?
v1k
Is there an easy way to convert simple html code to php?
v1k
Yep. Change the extension from .htm or .html to .php![]()
Peter - alotofstuffhere[dot]com - Email Me - Donate via PayPal - Got spare hardware? Donate 'em to me :) Just send me a PM.
Currently: enjoying the early holidays :)Read before posting: FAQ | What you CAN'T do with JavaScript | Form Rules | Thread Title Naming Guide
php doesn't do ANYTHING to anything that isn't in <?php ... ?> tags. (and I think there are other tags as well... <? ... ?> perhaps? <% ... %>? etc.)
Just changing the file extension will do fine.
Then you can add any php code you like in addition to the html source, just by putting it in the php brackets.
That's it
Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum
If your server supports php that is
Alternatively you can keep the .htm extension and still use php tags within by adding these 2 lines to your root .htaccess:
Code:AddType application/x-httpd-php .html .htm AddHandler application/x-httpd-php .html .php .htm
{CWoT - Riddle } {Freelance Copywriter} {Learn to Write}
Follow Me on Twitter: @InkingHubris
PHP Code:$result = mysql_query("SELECT finger FROM hand WHERE id=3");
echo $result;
Bookmarks