| Webmaster Forum Rules | Posting Guide | Contact Us | Testimonials | Contributing Geek Program | Advertise on Geek/Talk |
|
|
|||||||
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Registered User
Join Date: Mar 1999
Location: See Answers 2000 Limited
Posts: 2,618
|
I am trying to get the entire query string when the site is accessing with a URL like
http://www.somesite.com/?xyz (I want to get the xyz) If I do Response.Write Request.ServerVariables("QUERY_STRING") A link of the above form will not find the query string BUT A link of the this form http://www.somesite.com/default.asp?xyz (this is the same exact page) will find the query string. How to work round, and/or what is configured wrong |
|
|
|
|
|
#2 |
|
Registered User
Join Date: Nov 2001
Posts: 719
|
Have you tried going straight for request.querystring(variable)
e.g. mysite.com/?name=bob <% response.write Request.QueryString("name") %> |
|
|
|
|
|
#3 |
|
Registered User
Join Date: Mar 1999
Location: See Answers 2000 Limited
Posts: 2,618
|
Yep, same problem
There is some discussion about this in the newsgroups plus I posted at www.experts-exchange.com too I think it might be a bug/limitation in IIS4. A user at experts-exchange.com said this, and there seems to be documentation to confirm Right now, the best answer I have is to use Javascripts to catch this (I don't want to upgrade to IIS5 just for this), but i'm hoping somebody might hava better answer |
|
|
|
|
|
#4 |
|
Registered User
Join Date: Jul 2002
Location: United Kingdom
Posts: 79
|
I've done something similiarv for my http://www.gopictures.com site.
The registered users are given a URL such as http://www.gopictures.com/username. The way I did this was to re-direct the 404 error to a pages called redir.asp Heres the code for the redir.asp page. Its ASP/VBScript but I guess you could do something similiar with other languages: redir.asp ----------------------------- <% Response.Write Request.ServerVariables("QUERY_STRING") Foldervalue=split(Request.ServerVariables("QUERY_S TRING"),"/") Response.Write FolderValue(3) Response.Redirect "/Public/default.asp?User_ID=" & Foldervalue(3) %> |
|
|
|
|
|
#5 |
|
Registered User
Join Date: Mar 2001
Posts: 37
|
Haven't tested but something like this should work
<% varURL=request.servervariable("HTTP_REFERER") varFindQuestionMark=InStr(varURL,"?") varquerystring=mid(varURL,varFindQuestionMark+1,Le n(varURL)) Response.write varquerystring %> Meltdown \\\///// ~ ~ @ @ < \__/ Last edited by Meltdown; 09-20-2002 at 06:18 PM. |
|
|
|
|
|
#6 |
|
Registered User
Join Date: Mar 1999
Location: See Answers 2000 Limited
Posts: 2,618
|
Anything which does Request.ServerVariables or Request.QueryString doesn't work in IIS4 for the default page, if the page name, default.asp, is omitted.
This is a bug/limitation in IIS4 which is fixed in IIS5. Search google groups and it's all over them Upgrading to IIS5 is too drastic It might work (I haven't tried too drastic) to delete the default page, catch in a 404 handler, and then get the server variables Right now, the best solution I have is to catch the query string in a JavaScript. If the JavaScript also sees the page name is omitted, could redirect so www.yoursite.com/?xyz becomes www.yoursite.com/default.asp?xyz Not very good but workable. In my case, I am only interested in handling a particlar query string value, so I adapted the JavaScript to only do a redirect in this case. |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Making ASP pages | scnofx | Web Design and Webmaster Issues | 5 | 05-17-2001 12:38 AM |
| ASP | kris | Web Design and Webmaster Issues | 2 | 12-31-2000 06:55 PM |
| ASP, CGI, SQL, mySQL ... ... | CYBERWORLD | Web Design and Webmaster Issues | 5 | 05-24-2000 11:38 PM |
| Advices on ASP, Visual Basic, Visual C++ | fatso | Web Design and Webmaster Issues | 6 | 10-19-1999 01:07 PM |
| ASP Samples/Help | WildComputer | Web Design and Webmaster Issues | 11 | 07-21-1999 07:44 AM |
![]()