If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > inc vs. asp

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-07-06, 09:21
poison_chicken poison_chicken is offline
Registered User
 
Join Date: Feb 2006
Posts: 34
inc vs. asp

can you tell me the difference between these. in other words, i am confused about server side includes. i can "include" a file (server side) with either extension (asp or inc) right...such as:

<!--#include file=name.asp-->

<!--#include file=name.inc-->

what benefit does the "include" (.inc) extension have? why should i name it .inc?


secondly, using firefox, i get the everything inside of <% %> as text. firefox is a pretty common browser these days...will asp not work within firefox?
Reply With Quote
  #2 (permalink)  
Old 03-07-06, 11:26
jfulton jfulton is offline
Registered User
 
Join Date: Apr 2005
Location: Baltimore, MD
Posts: 297
Although it is common, using *.inc to name your asp includes is not a good idea. Say you have an include in a folder, like /www/includes/login.inc. Now suppose I figure out where this include lives on your webserver. If I can gain access to the *.inc file, then I can read all of your asp code. If the include is named *.asp, then it will be executed before it is sent to the client and thus I won't be able to read your code. So name anything with asp code in it as *.asp.

If your code isn't being executed before it is being sent out to the client then there is either something wrong with your server configuration or (sometimes) your code. It has nothing to do with the client browser.

Hope that helps .
Reply With Quote
  #3 (permalink)  
Old 03-07-06, 13:20
poison_chicken poison_chicken is offline
Registered User
 
Join Date: Feb 2006
Posts: 34
well, it isn't even on a server (yet)...so i am not expecting it to do anything, but when i "preview" the page (that contains asp) in say safari, i get a page as it looks...but in firefox when i preview it, i get the asp code as text on the page.
Reply With Quote
  #4 (permalink)  
Old 03-07-06, 13:30
jfulton jfulton is offline
Registered User
 
Join Date: Apr 2005
Location: Baltimore, MD
Posts: 297
Unless you're accessing the file differently in the two browsers (ie. "C:/dir/dir/file.asp" vs. "http://localhost/file.asp") then the source should be the same. View the source in each browser and they should be identical. It doesn't make sense that they wouldn't be. Safari and firefox may parse the asp code tags differently (I'm not sure), but the source code will be the same.
Reply With Quote
  #5 (permalink)  
Old 03-08-06, 04:12
kropes2001 kropes2001 is offline
Registered User
 
Join Date: Nov 2005
Location: Honolulu HI
Posts: 118
yes...
what jfulton was saying about using ASP.
even if you do not have ASP code in it, it is a good idea just to force the habit

but for instance, I know a lot of people that set up their data access (connection strings) as a separate file and include it into their pages so they do not have to code it over and over...
if it is INC... and I figure it out... I then can get complete access to your database, possibly even your hosting account if your username and password are the same.
__________________
.
.
http://www.GetMySiteOnline.com - Can you help me Get My Site Online ? (Yes. That is EXACTLY what we do.)

http://www.GetMySiteOnline.com/FightingSpam/
__________________________
caeli enarrant gloriam Dei !
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On