Results 1 to 5 of 5

Thread: inc vs. asp

  1. #1
    Join Date
    Feb 2006
    Posts
    34

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

  2. #2
    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 .

  3. #3
    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.

  4. #4
    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.

  5. #5
    Join Date
    Nov 2005
    Location
    Honolulu HI
    Posts
    119
    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.HawaiianHope.org
    Providing Technology services to non profit orgs, Homeless Shelters, Food Pantries, Clean And Sober Houses and more.
    To date we have given away over 900 free computers !
    __________________________
    caeli enarrant gloriam Dei !

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •