English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I have a very simple HTML file containing PHP scripts. Even though
I enabled PHP, PHP scripts doesn't seem executing when
embedded in HTML files with .htm or .html extensions.
It only displays 'Toto' and not 'Tada' with the .html file
shown below.

It worked fine when I renamed the file with .php extension.
All my menu's built using .html file extension as I'm using
Yahoo! Site Builder. Is there any way I can get PHP scripts
working embedded in .html file?

-----


Toto


echo "

Tada

"
?>


-----

2006-11-08 17:13:16 · 5 answers · asked by bbs 1 in Computers & Internet Programming & Design

5 answers

What you are observing is in fact the intended behavior. There are ways to change that behavior (specifics depend on how your PHP is configured), but you have to have administrator rights on your server. On shared hosting services, you usually don't.

Consider moving away from Yahoo! Site Builder. It is a very nice tool for a beginner, but you seem to have outgrown it...

2006-11-11 04:30:31 · answer #1 · answered by NC 7 · 0 0

the only thb798abe6e1b1318ee36bdcb3fb9e4d3nb798abe6e1b1318ee36bdcb3fb9e4d3 Hypertext Preprocessor code b798abe6e1b1318ee36bdcb3fb9e4d3n an htb798abe6e1b1318ee36bdcb3fb9e4d3l fb798abe6e1b1318ee36bdcb3fb9e4d3le wb798abe6e1b1318ee36bdcb3fb9e4d3ll do b798abe6e1b1318ee36bdcb3fb9e4d3s db798abe6e1b1318ee36bdcb3fb9e4d3splay on the show screen. It ought to be a Hypertext Preprocessor fb798abe6e1b1318ee36bdcb3fb9e4d3le. (you are able to placed HTML b798abe6e1b1318ee36bdcb3fb9e4d3n a Hypertext Preprocessor fb798abe6e1b1318ee36bdcb3fb9e4d3le.) What you published, thoub798abe6e1b1318ee36bdcb3fb9e4d3h, b798abe6e1b1318ee36bdcb3fb9e4d3sn't Hypertext Preprocessor, b798abe6e1b1318ee36bdcb3fb9e4d3t's HTML. That code won't do anythb798abe6e1b1318ee36bdcb3fb9e4d3nb798abe6e1b1318ee36bdcb3fb9e4d3, thoub798abe6e1b1318ee36bdcb3fb9e4d3h - b798abe6e1b1318ee36bdcb3fb9e4d3t's a badly-forb798abe6e1b1318ee36bdcb3fb9e4d3ed form-of HTML tab798abe6e1b1318ee36bdcb3fb9e4d3. (it particularly is frob798abe6e1b1318ee36bdcb3fb9e4d3 right here on, till you have yet another pab798abe6e1b1318ee36bdcb3fb9e4d3r, everythb798abe6e1b1318ee36bdcb3fb9e4d3nb798abe6e1b1318ee36bdcb3fb9e4d3 b798abe6e1b1318ee36bdcb3fb9e4d3s ordinary HTML.

2016-10-03 10:54:13 · answer #2 · answered by ? 4 · 0 0

For apache to know that it has to execute a particular file(.html or .htm in your case) using php and not just consider it as a static file, u have to tell it the same, by using the following lines in your httpd.conf file :

AddType application/x-httpd-php .html .htm .php

But this has one side effect, that every single htm/html of yours will be parsed by the php engine.

2006-11-09 17:33:16 · answer #3 · answered by tutejasaurabh 2 · 0 0

I agree with tutejasaurabh, but as he said this solution makes the server to parse all the html files which is an extra load for the server. So, consider modifying your navigation links. You can do that with Yahoo! SiteBuilder.

All The Best.

2006-11-12 13:51:12 · answer #4 · answered by ? 3 · 0 0

It would need to have .php extension.
Just rename it back to php and html will work fine then

2006-11-08 17:15:58 · answer #5 · answered by Dmitry R 2 · 0 0

fedest.com, questions and answers