View previous topic :: View next topic |
Author |
Message |
snickle -
Joined: 13 Jun 2008 Posts: 2
|
Posted: Fri Jun 13, 2008 8:05 pm Post subject: Running PHP code in html pages |
|
|
I am playing around with the Abyss Web server and PHP. I can run files with a .php no problem. But I can't the server to execute ?php commands included in an html file.
To fix this in apache I would modify the .htaccess file. How can I do this Abyss? |
|
Back to top |
|
|
AbyssUnderground -
Joined: 31 Dec 2004 Posts: 3855
|
Posted: Fri Jun 13, 2008 8:06 pm Post subject: |
|
|
Easy, just make ".html" an interpreter file extension and it will then start executing php code. _________________ Andy (AbyssUnderground) (previously The Inquisitor)
www.abyssunderground.co.uk |
|
Back to top |
|
|
Kees -
Joined: 22 Feb 2004 Posts: 3
|
Posted: Fri Jun 13, 2008 11:33 pm Post subject: |
|
|
I think renaming *.html to *.php is a better solution.
Only *.php files should be executed by the PHP parser, not any *.html file. |
|
Back to top |
|
|
snickle -
Joined: 13 Jun 2008 Posts: 2
|
Posted: Sat Jun 14, 2008 2:28 am Post subject: |
|
|
Actually in this case I can't rename teh html file, so the other option solved my immediate problem. |
|
Back to top |
|
|
lagibosen -
Joined: 29 Jun 2008 Posts: 2
|
Posted: Sun Jun 29, 2008 1:29 am Post subject: |
|
|
try to modify your .htaccess file. and read manual about rewrite _________________ Support Busby SEO Challenge |
|
Back to top |
|
|
Toasty -
Joined: 21 Feb 2008 Posts: 298 Location: Chicago, IL
|
Posted: Sat Jul 05, 2008 11:48 am Post subject: |
|
|
I use .html to execute all of my PHP scripts on all of my sites and have never had a problem.
Like the first reply said, just add HTML to your list of extensions ran by PHP... _________________ Audit the secure configuration of your server headers! |
|
Back to top |
|
|
hc2995 -
Joined: 07 Aug 2006 Posts: 644 Location: Maryland, USA
|
Posted: Thu Jul 10, 2008 8:04 am Post subject: |
|
|
wont running php in an html file make the code visable? or will the fact that .html is a file to be ran by the php engine make the code hidden? _________________ Where have i been? School got heck-tick, had to move half way around the state, then back... and then i had to change jobs, so iv been away for a while :P |
|
Back to top |
|
|
rrinc -
Joined: 24 Feb 2006 Posts: 725 Location: Arkansas, USA
|
Posted: Thu Jul 10, 2008 8:07 am Post subject: |
|
|
PHP code is PHP code. PHP doesn't care of your file is named index.php, index.xyz, or even index.doc. If it contains PHP code (in a plain text format of course), PHP will execute it if told to. _________________ -Blake | New Server :D
SaveTheInternet
Soy hispanohablante. Puedes contactarme por mensajes privados. |
|
Back to top |
|
|
lspence -
Joined: 16 Jul 2004 Posts: 15
|
Posted: Sun Jul 13, 2008 3:43 am Post subject: |
|
|
hc2995 wrote: | wont running php in an html file make the code visable? or will the fact that .html is a file to be ran by the php engine make the code hidden? |
People won't be able to see your code. If they view the Page Source, they'll just see html, and not php. _________________ Luke Spence - CJCA - Cracker Jack Collectors Association |
|
Back to top |
|
|
scottlpool2003 -
Joined: 13 Sep 2008 Posts: 3
|
Posted: Sat Sep 13, 2008 9:55 pm Post subject: Cheers |
|
|
I didn't know that it was possible to use PHP commands in .html files without either making it a .php or using the rewrite. *kicks self* _________________ Watch Free Movies - MySpace Unblock - Online Movies |
|
Back to top |
|
|
|