PDA

View Full Version : ASP Includes


the_pm
December 1st, 2004, 02:17
Ok, I just did my first ASP include as a test, and I discovered both .txt and .asp files seems to include exactly the same way. This may be the case for PHP as well (my understanding is that SSIs require .txt files), but is there any functional difference between these method? Is one preferred over the other?

http://www.gasserjewelers.com/test/test.asp

Corey Bryant
December 1st, 2004, 02:35
As far as I know - it depends on the server I think. I know on our servers, we can also use the extensions INC as well.

As far as functional - I cannot think of anything. They are parsed with the same DLL (ASP & SHTML).

the_pm
December 1st, 2004, 02:37
Ahh, that makes sense. That's why I always see the two lumped together in tutorials. Funny how SSIs are so prevalent on Linux servers, yet parsed by the DLL that handles ASP too. Next, you'll tell me there's nothing peculiar about this, and you'll explain why...I hope...

Dan
December 1st, 2004, 02:37
I know that in PHP it doesn't matter what the file type is. I could include a '.thisisntafile' and it would still parse the same. I believe ASP would work the same.

I don't think there's any difference, but I generally try to use .php files if they have any PHP code in it, and would do the same for ASP.

sonicgroup
December 1st, 2004, 02:41
How PHP includes work: A crash course.

PHP doesn't parse an included file. All it does is take the contents of the included file and dump it into the file it's included from. Now, if the included file happens to contain additional PHP, then it's parsed, but as a part of the initial page, not through the inclusion process.

As for SSI, you can include virtually any file you want, so long as you choose the right type of include (file or virtual).

Corey Bryant
December 1st, 2004, 02:48
Ahh, that makes sense. That's why I always see the two lumped together in tutorials. Funny how SSIs are so prevalent on Linux servers, yet parsed by the DLL that handles ASP too. Next, you'll tell me there's nothing peculiar about this, and you'll explain why...I hope...
I wished - I actually asked the question once on a few boards & was told that (I was trying to cut down the load on my servers). But since they both used the same file etc, not too much I could do there

sonicgroup
December 1st, 2004, 02:51
This is in no way authoritative, but my guess would be that since IIS was built to serve ASP, the functionality for includes was built into the same DLL to simplify everything (versus Apache which handles includes via a module [mod_include] and was built specifically for serving straight HTML pages).