Page 1 of 1
HTLM without PHP support
Posted: Wed Apr 21, 2004 8:10 pm
by tazz
The next code doesn´t work:
<html>
<body>
<?php
$myvar = "Hello PHP World! \n";
echo $myvar;
?>
</body>
</html>
Please Help me
Thanks

Posted: Wed Apr 21, 2004 8:19 pm
by Unipus
Well if you don't have PHP, why would you expect PHP code to work?
Posted: Wed Apr 21, 2004 8:30 pm
by John Cartwright
Unipus wrote:Well if you don't have PHP, why would you expect PHP code to work?
dont u know money and php support grows on trees....
Posted: Wed Apr 21, 2004 8:30 pm
by feyd
.html files aren't processed by default. You have to enable it on whatever server you are using if you really want it.
Posted: Wed Apr 21, 2004 8:48 pm
by tazz
yes, I have PHP installed, on linux 7.3 and apache 2.0
the code before view is in .html file
Posted: Wed Apr 21, 2004 8:55 pm
by feyd
k in your conf file there's a line similar to this:
Code: Select all
AddType application/x-httpd-php .php
adding .html and whatever other file formats you want php to process there should take care of it.
Posted: Thu Apr 22, 2004 6:15 am
by magicrobotmonkey
or I think the more standard (and hopefully more clear in the long run) approach would be to save the file as a .php file. There's no reason to go confusing everything by processing .html files as php (usually, ok so there might be occasionaly a reason to do that, but it'd better be a darned good one)
Posted: Thu Apr 22, 2004 6:27 am
by d3ad1ysp0rk
Only reason to parse .html as .php: If you have over 20 pages linked together WITHOUT a good system of navigation (ie. Includes, iframes, etc, anything where links can be changed on only one page but effects the whole site). Then it becomes a nightmare to change every page to link to a .php instead of .html, but besides that, it's easier to do just that, switch them to .php..
Posted: Thu Apr 22, 2004 6:54 am
by magicrobotmonkey
mmm.. that's not darned good enough! but i know what you mean - i had to take over administrating a poorly designed (static) site and they would ask me to like "add a tab" something they thought was small and easily done and it would take me hours of opening, pasting, and closing the stupid things... That's why I'm redoing it all using php, and css and charging a lot!