Pioneer Skin
Login  ::  Register
Friday, September 03, 2010
 
- - - - - - - - Sponsorship Advertisement Area - - - - Thank you to our Sponsors - - - - - - - - -
Net Magik Pros - Battle Creek, Michigan Web Designers

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:7


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:28


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

Posts:0


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
Kekoa MakaioUser is Offline
Newbie
Newbie
Posts:3


06/16/2009 2:31 PM  

Welcome I run a website that is partially HTML and partially PHP, and I would like for people to only be able to access a file if they were linked to if from a certain file, for example i have a homepage and also i have a php page, i want for people to have to be logged in before they can view that php page.

atlanta website development


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



ActiveForums 3.7
Home | Membership | Events | Forum | MyPage | Login
Copyright 2007-2008 by WGD Forum :: Designed by ZapWebDesign.com