Tests AxInclude, AxIncludeOnce, and AxGetRemoteFile custom functions.
AxInclude and AxIncludeOnce execute ASP files (same as <!--# include -->).
AxGetRemoteFile fetches remote content as plain text (not executed).
Call AxInclude with a relative path to execute an ASP file:
If AxInclude("config.inc") Then
Response.Write "File executed successfully"
Else
Response.Write "Failed to include file"
End If
✗ Failed to include config.inc
Call AxInclude with a non-existent file (should return false):
If AxInclude("nonexistent_file.asp") Then
Response.Write "File found"
Else
Response.Write "File not found (error shown in console)"
End If
✓ Correctly returned false for missing file
Check server console for error message
Call AxIncludeOnce with the same file multiple times:
AxIncludeOnce "config.inc"
AxIncludeOnce "config.inc"
AxIncludeOnce "config.inc"
First call:
Second call (should be ignored):
Third call (should be ignored):
✓ File was only executed once despite three calls
Test AxIncludeOnce with different files:
AxIncludeOnce "config.inc"
AxIncludeOnce "config.inc" ' Will be ignored
AxIncludeOnce "header.inc" ' Will execute
Including config.inc:
Attempting to include config.inc again (will be ignored):
Note: header.inc content would appear here if it was an ASP file
Test with explicit relative path prefix (./):
AxInclude "./config.inc"
Call AxGetRemoteFile to fetch content from a remote URL:
Dim content
content = AxGetRemoteFile("https://example.com/robots.txt")
✓ Successfully fetched remote content
Content length: 412 bytes
First 200 characters:
User-agent: * Allow: / Allow: /libs/98.css/ Allow: /libs/98.css/windows_icons/ Allow: /libs/bootstrap/ Allow: /libs/fonts/ Allow: /libs/jquery/ Allow: /libs/software/ Allow: /libs/vue/ Allow: diagplus...
Call AxGetRemoteFile with invalid URL format (should return false):
If AxGetRemoteFile("ftp://example.com/file.txt") = False Then
Response.Write "Invalid protocol (FTP not supported)"
End If
✓ Correctly rejected unsupported protocol
Check server console for error message
Test that AxGetRemoteFile rejects local file paths for security:
If AxGetRemoteFile("C:\Windows\System32\config\system") = False Then
Response.Write "Local paths are not allowed"
End If
✓ Local file paths are blocked for security
Important: Error messages from AxInclude, AxIncludeOnce, and AxGetRemoteFile are printed to the server console, not to the browser.
Check your terminal/console output to see detailed error messages for debugging.
G3pix AxonASP - Custom Functions Test Suite