G3pix AxonASP - AxInclude, AxIncludeOnce, and AxGetRemoteFile Test

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).

Test 1: AxInclude - Execute ASP File

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
Output:

✗ Failed to include config.inc

Test 2: AxInclude - File Not Found

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
Output:

✓ Correctly returned false for missing file

Check server console for error message

Test 3: AxIncludeOnce - Prevent Duplicate Execution

Call AxIncludeOnce with the same file multiple times:

AxIncludeOnce "config.inc"
AxIncludeOnce "config.inc"
AxIncludeOnce "config.inc"
Output (file should only be executed once):

First call:

Second call (should be ignored):

Third call (should be ignored):

✓ File was only executed once despite three calls

Test 4: AxIncludeOnce - Different Files

Test AxIncludeOnce with different files:

AxIncludeOnce "config.inc"
AxIncludeOnce "config.inc"  ' Will be ignored
AxIncludeOnce "header.inc"   ' Will execute
Output:

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 5: Path Resolution - Relative Paths

Test with explicit relative path prefix (./):

AxInclude "./config.inc"
Output:

Test 6: AxGetRemoteFile - Fetch Remote Content

Call AxGetRemoteFile to fetch content from a remote URL:

Dim content
content = AxGetRemoteFile("https://example.com/robots.txt")
Result:

✓ 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...

Test 7: AxGetRemoteFile - Invalid URL

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
Result:

✓ Correctly rejected unsupported protocol

Check server console for error message

Test 8: Security - Local Path Rejection

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
Result:

✓ Local file paths are blocked for security

Check Server Console

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