Pioneer Skin
Login  ::  Register
Friday, September 05, 2008
 
Private Messages
You must be logged in to use this module.
- - - - - - - - Sponsorship Advertisement Area - - - - Thank you to our Sponsors - - - - - - - - -
Visit the Grand Rapids Area Chamber of Commerce

We are please to introduce the new and improved discussion forum. It should eliminate the issues we've been having with the discusson board in the past. The old forum will still be available in "read only" mode HERE in case anyone wants to review the old topics that were posted.

WGD Forum: Discussion
Subject: PHP in HTML pages
Prev Next
You are not authorized to post a reply.

Author Messages
therustycookUser is Offline
Newbie
Newbie
Posts:4


06/02/2008 2:34 PM  

Well here is the question for you all.  I am wanting to have my pages on my website be .htm files but need to put in php code into them.  I know I have seen a way to do this where I reference the php file from within the htm page.  I just cannot remember how to do this.  I am sure if I just see an example or two I will like totally have it.  I just wish I would have written down before how it was done. 

tgoodsonUser is Offline
Newbie
Newbie
Posts:19


06/02/2008 3:33 PM  
Talk about a loaded question! The answer is it depends on just what you're trying to do with the php code. If it is to display an image, just set the src attribute of the image to the php file. Or you could insert an iframe into your html and set its source to your php. Let me know what you're trying to do and I be more specific.
spignataroUser is Offline
Newbie
Newbie
Posts:2


08/28/2008 9:57 PM  
ACtually this is a very simple answer- I hope you are on a linux box with PHP and mod-rewite turned on. Because this is the most simplitic way - you rewrite the urls from .php to .html so bascially you have php files with html data and your php data but when pulled up in the address bar you get .html

So you would put the following in your .htaccess file:

[code]
Options +FollowSymlinks
RewriteEngine on
RewriteRule ^(.*)\.php$ $1.html [NC]
[/code]

I hope this helps - there is alot of information on .htaccess:

http://www.google.com/search?hl=en&safe=off&client=firefox-a&rls=org.mozilla%3Aen-US%3Aofficial&hs=uHt&q=rewrite+url+%2Bhtaccess&btnG=Search
http://www.google.com/search?q=mod_rewrite&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a

Enjoy.

Kindest regards,

--Steven Pignataro
You are not authorized to post a reply.
Forums > Web Design > Programming > PHP in HTML pages



ActiveForums 3.7
Home | About Us | Membership | Forum | MyPage
Copyright 2007 by WGD Forum :: Designed by ZapWebDesign.com