Running PHP code in html pages

 
Post new topic   Reply to topic    Aprelium Forum Index -> PHP
View previous topic :: View next topic  
Author Message
snickle
-


Joined: 13 Jun 2008
Posts: 2

PostPosted: Fri Jun 13, 2008 8:05 pm    Post subject: Running PHP code in html pages Reply with quote

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 View user's profile Send private message
AbyssUnderground
-


Joined: 31 Dec 2004
Posts: 3855

PostPosted: Fri Jun 13, 2008 8:06 pm    Post subject: Reply with quote

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 View user's profile Send private message Visit poster's website
Kees
-


Joined: 22 Feb 2004
Posts: 3

PostPosted: Fri Jun 13, 2008 11:33 pm    Post subject: Reply with quote

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 View user's profile Send private message
snickle
-


Joined: 13 Jun 2008
Posts: 2

PostPosted: Sat Jun 14, 2008 2:28 am    Post subject: Reply with quote

Actually in this case I can't rename teh html file, so the other option solved my immediate problem.
Back to top View user's profile Send private message
lagibosen
-


Joined: 29 Jun 2008
Posts: 2

PostPosted: Sun Jun 29, 2008 1:29 am    Post subject: Reply with quote

try to modify your .htaccess file. and read manual about rewrite
_________________
Support Busby SEO Challenge
Back to top View user's profile Send private message
Toasty
-


Joined: 21 Feb 2008
Posts: 298
Location: Chicago, IL

PostPosted: Sat Jul 05, 2008 11:48 am    Post subject: Reply with quote

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 View user's profile Send private message Visit poster's website
hc2995
-


Joined: 07 Aug 2006
Posts: 644
Location: Maryland, USA

PostPosted: Thu Jul 10, 2008 8:04 am    Post subject: Reply with quote

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 View user's profile Send private message AIM Address
rrinc
-


Joined: 24 Feb 2006
Posts: 725
Location: Arkansas, USA

PostPosted: Thu Jul 10, 2008 8:07 am    Post subject: Reply with quote

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 View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
lspence
-


Joined: 16 Jul 2004
Posts: 15

PostPosted: Sun Jul 13, 2008 3:43 am    Post subject: Reply with quote

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 View user's profile Send private message Visit poster's website
scottlpool2003
-


Joined: 13 Sep 2008
Posts: 3

PostPosted: Sat Sep 13, 2008 9:55 pm    Post subject: Cheers Reply with quote

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 View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> PHP All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group