Pioneer Skin
Login  ::  Register
Monday, February 06, 2012
 
- - - - - - - - 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:32


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

Posts:0


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

jammydougUser is Offline

Posts:0


09/17/2010 5:01 AM  

Hi
How to hide PHP script in PHP/ HTML page?I check one web page written in PHP, but when I view source it, there's no php script in the source code. It's pure HTML. I'm pretty sure there's some php script in that page since it processes a form.

____________

Facebook apps

tgoodsonUser is Offline
Newbie
Newbie
Posts:32


09/17/2010 10:47 AM  
By the very nature of a PHP page, it will never send the .PHP code to the browser, just the resuits of the PHP being executed. When you do a "view source" from your browser, you get the html source and not the PHP source (since the browser never sees the PHP). If you want to see the PHP source code, you'll need FTP or other access to the server and download the page without it being processed by the server first.

** Tom **
www.omega-link.com
jamesjohnUser is Offline

Posts:0


03/15/2011 8:45 AM  

If it sees a .php extension (or .shtml, or .asp, etc), it knows that it needs to execute the appropriate code before passing it along to the browser.

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