PDA

View Full Version : query strings and includes



sillo
November 8th, 2002, 22:07
is it possible to include an asp file with query strings (like thing.asp?t=4)?

if so, how?

thanks :)

tingin
November 10th, 2002, 20:46
You mean like this:
<script src="http://www.yourDomain.com/yourscript.asp?t=4"></script>

Or like this:
<!--include virtual="/fullpath/yourscript.asp?t=4"-->

sillo
November 10th, 2002, 23:37
like the second one with the include. i dont even know what the first one does. :\

NukedWeb
November 14th, 2002, 23:49
I know this's prolly an old post, but I'll answer it anyways for future reference. This is true for PHP, and I'm willign to bet it true for all server-side includes. Including a file by a path ("./file.asp") opens it locally. The full URL opens it *after* executing/processing the code, because it's reading it oiver the webserver. Now, if you did it remotely, via the full URL, you can add ?t=4 and it'll work. However, if you access it locally, you can set the variable first, then include it, such as
$t = 4;
include "./file.php";

and it'll do it the same way...

guitarnerd
November 15th, 2002, 01:30
If you are trying to include it for code reasons look at ASP.NET you can use Code Behinds and program in any .NET supported language.