User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 455,979 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,786 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 4733 | Replies: 8
Reply
Join Date: May 2004
Location: Toronto, Ontario (Canada)
Posts: 384
Reputation: ep2002 is an unknown quantity at this point 
Rep Power: 5
Solved Threads: 0
ep2002's Avatar
ep2002 ep2002 is offline Offline
Posting Whiz

Help PHP & File Extensions

  #1  
Aug 25th, 2004
Hi all,

I'm trying to see if this programmer knows what he is talking about.

I'm going to be changing all my files from .phtml to either .htm or .php

I have a small amount of php on my site... http://www.exoticpublishing.com

This programmer is saying that I can change it to .htm & it won't harm anything b/c there is little to no php on the site.

Another programmer is telling me NO, I have to make it .php

What do you guys think?

Thanks & TTYL


Michelle
I can help you get a merchant account whether mainstream or high risk...

http://www.exoticpublishing.com/merchant-accounts.php


AddThis Social Bookmark Button
Reply With Quote  
Join Date: Feb 2002
Location: Lawn Guylen, NY
Posts: 11,019
Reputation: cscgal is just really nice cscgal is just really nice cscgal is just really nice cscgal is just really nice cscgal is just really nice 
Rep Power: 33
Solved Threads: 116
Admin
Staff Writer
cscgal's Avatar
cscgal cscgal is offline Offline
The Queen of DaniWeb

Re: PHP & File Extensions

  #2  
Aug 25th, 2004
In almost all cases, if a page contains no PHP code, it can have either a .php or a .htm extension. If a page does contain even one line of actual PHP code, it must have a .php extension.

To be perfectly honest though, anyone with a dedicated server can edit their Apache httpd configuration to allow any extension to be an alias for any other extension. For example, you can say that .htm and .phtml are both aliases for .php, and therefore all 3 can run PHP code. Doing this would take a system administrator / linux techie type person to make the appropriate change.
Reply With Quote  
Join Date: Aug 2004
Posts: 49
Reputation: felgall is an unknown quantity at this point 
Rep Power: 5
Solved Threads: 1
felgall felgall is offline Offline
Light Poster

Re: PHP & File Extensions

  #3  
Aug 25th, 2004
If you add the following line to your .htaccess file then files ending .html or .phtml will be treated the same as those ending .php

AddHandler server-parsed .html .phtml
Reply With Quote  
Join Date: May 2004
Location: Toronto, Ontario (Canada)
Posts: 384
Reputation: ep2002 is an unknown quantity at this point 
Rep Power: 5
Solved Threads: 0
ep2002's Avatar
ep2002 ep2002 is offline Offline
Posting Whiz

Re: PHP & File Extensions

  #4  
Aug 26th, 2004
Thanks guys. I'm trying to establish if this guy really knows anything about developing web sites, or he's just a DB programmer.

Take care


Michelle
I can help you get a merchant account whether mainstream or high risk...

http://www.exoticpublishing.com/merchant-accounts.php


Reply With Quote  
Join Date: Apr 2004
Location: Tracy
Posts: 744
Reputation: Killer_Typo will become famous soon enough Killer_Typo will become famous soon enough 
Rep Power: 7
Solved Threads: 32
Killer_Typo's Avatar
Killer_Typo Killer_Typo is offline Offline
Master Poster

Re: PHP & File Extensions

  #5  
Aug 26th, 2004
Originally Posted by felgall
If you add the following line to your .htaccess file then files ending .html or .phtml will be treated the same as those ending .php

AddHandler server-parsed .html .phtml

I like this idea, but could this same idea be used to lets say make a page read

http://www.example.com/index

instead of

http://www.example.com/index.htm

??
!!!!! WARNING YOUR COMPUTER MAY BE INFECTED WITH SPYWARE!!!! PAY AN OVER PRICED AMMOUNT TO HAVE SOMTHING FIXED WE PLACED THERE IN THE FIRST PLACE!!!!!!!!!

sound familiar, know how to block yourself and keep yourself clean.
_____________________
http://www.lavasoftusa.com/ -->adaware
http://www.safer-networking.org/en/index.html -->spybot S&D
http://www.javacoolsoftware.com/spywareblaster.html -->spywareblaster
http://www.javacoolsoftware.com/spywareguard.html -->spywareguard
_____________________
and dont forget to spread the reputation to those that deserve!
Reply With Quote  
Join Date: Mar 2004
Location: In a house
Posts: 94
Reputation: Ragnarok is an unknown quantity at this point 
Rep Power: 5
Solved Threads: 0
Ragnarok Ragnarok is offline Offline
Junior Poster in Training

Re: PHP & File Extensions

  #6  
Aug 26th, 2004
You can do that, but you have to tell the server to exicute that file (since it cannot be registered with a file type) I don't remember the code for this. You could also use mod_rewrite to remove the etentions off the files as well
Reply With Quote  
Join Date: Aug 2004
Posts: 177
Reputation: YoungCoder is an unknown quantity at this point 
Rep Power: 5
Solved Threads: 2
YoungCoder's Avatar
YoungCoder YoungCoder is offline Offline
Junior Poster

Solution Re: PHP & File Extensions

  #7  
Aug 27th, 2004
Originally Posted by Ragnarok
You can do that, but you have to tell the server to exicute that file (since it cannot be registered with a file type) I don't remember the code for this. You could also use mod_rewrite to remove the etentions off the files as well

RewriteRule ^fileneame.*$ filename.php [L]

Using that line for mod_rewrite you could use anything, so if you went to filename.htm it would work, if you went to filename.file it would work, it would even work if you went to filename.thisisareallygreatwebsite .


Just remove the "." to make it only work at filename with no extension

YOungCoder
Reply With Quote  
Join Date: Feb 2002
Location: Long Island, NY
Posts: 1,134
Reputation: samaru is just really nice samaru is just really nice samaru is just really nice samaru is just really nice 
Rep Power: 12
Solved Threads: 5
Colleague
samaru's Avatar
samaru samaru is offline Offline
a.k.a inscissor

Re: PHP & File Extensions

  #8  
Aug 28th, 2004
Originally Posted by ep2002
This programmer is saying that I can change it to .htm & it won't harm anything b/c there is little to no php on the site.
Is he a logo programmer? An HTML programmer? People really abuse the heck out of that title. In all honestly, any decent programmer will tell you that there will be a change in your web pages even if you have the smallest amount of PHP code on your page.

Other than that, I would say pretty much the same thing everyone else said with extra mayo.
_.:: my websites ::._
blog @ www.samaru.net * engi No Jutsu @ www.narutorp.net * portfolio @ shinylight.com
deviantART: inscissor
Reply With Quote  
Join Date: May 2004
Location: Toronto, Ontario (Canada)
Posts: 384
Reputation: ep2002 is an unknown quantity at this point 
Rep Power: 5
Solved Threads: 0
ep2002's Avatar
ep2002 ep2002 is offline Offline
Posting Whiz

Re: PHP & File Extensions

  #9  
Sep 1st, 2004
<sigh>

I don't know what he is.

He claims to have worked as a VP of a large company & his background is with DBs & he knows PHP.

I started getting worried when a few things didn't make sense, then this issue & now today another issue.

My problem is, he knows my user names & p/wds on some of my pages & since he was to be a suedo partner, I'm nervous, but I have to cut my ties. I can't keep wondering whether he really knows what he's talking about. :o

Wish me luck as I have a midnight meeting w/ him.



Michelle

Originally Posted by inscissor
Is he a logo programmer? An HTML programmer? People really abuse the heck out of that title. In all honestly, any decent programmer will tell you that there will be a change in your web pages even if you have the smallest amount of PHP code on your page.

Other than that, I would say pretty much the same thing everyone else said with extra mayo.
I can help you get a merchant account whether mainstream or high risk...

http://www.exoticpublishing.com/merchant-accounts.php


Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb PHP Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the PHP Forum

All times are GMT -4. The time now is 9:20 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC