VBScript Conditional Includes
This is a nasty one to track down in production, so I’m going to show you here.
VBScript has a fun way of interpreting include references that are nested inside an if statement. It will load all include references. If you have different functions, with the same name, it will use the second one.
Example
myTest_inc1.asp:
myTest_inc2.asp:
myTest.asp:
The output of myTest.asp is:
Case 1 executing…
Function 1 loaded…
Function 2 executing…
6
Thanks for reading.
Previous
Next