Quick Q regarding querystrings

S

Steven Burn

I'm probably missing something stupidly obvious here but, I've been trying
to figure out how the likes of aspfaq.com etc, do the following;

<domain>/?querystring

I've tried everything I can think of, aswell as (obviously) checking for
this in the default.asp file, Anyone fancy getting rid of my brainfart for
me please?

This is what I put in the default.asp test file;

<%
s = request.querystring("s")
if s = "" then
'// do nothing
else
'// show it
response.write s
end if
%>

..... rest of page content

--

Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!

Personal favourites

Practically Nerded - http://mvps.org/PracticallyNerded/
Bugs, Glitches n stuff - http://mvps.org/inetexplorer/Darnit.htm
Calendar of Updates - http://www.dozleng.com/updates/index.php?&act=calendar
 
A

Alan Howard

Could be a custom 404 with a script to parse the name of the requested URL,
extract the last bit, and redirect.
 
A

Andrew Urquhart

*Steven Burn* said:
I'm probably missing something stupidly obvious here but, I've been
trying to figure out how the likes of aspfaq.com etc, do the
following;

<domain>/?querystring

I've tried everything I can think of, aswell as (obviously) checking
for this in the default.asp file, Anyone fancy getting rid of my
brainfart for me please?
<snip/>

Not exactly sure what you're asking but I'm assuming you mean having
URIs with a querystring with just a key and no value such as

domain.com/?key
....instead of...
domain.com/?key=value

If that's the case then: Request.QueryString.Key(1) will return the key
name, the data probably being a primary key, hash table item or filepath
fragment.
 
A

Andrew Urquhart

*Steven Burn* said:
I'm actually wondering how they can have;
<domain>/?
All I can get working is;
<domain>/default.asp?

Ah, like www.andrewu.co.uk/webtech/archive/?entry=602 ;-)

I've not had to consciously do anything to make this work, 'default.asp'
is a default document, server is IIS5. Not sure this URI format works on
previous IIS versions though. You could try asking in one of the IIS
groups.
 
S

Steven Burn

A

Andrew Urquhart

*Steven Burn* said:
Thats exactly what I mean!!, hehe ;o)
Only, without having to have the key, so;

http://www.andrewu.co.uk/webtech/archive/?entry=602
would be (for example)
http://www.andrewu.co.uk/webtech/archive/?602

I don't know what you'll need to do to fix the required default document
issue, omitting the default document from the URI was available to me
'out of the box' for IIS5 under Win2K, try asking in an IIS group. The
value-only querystring can be decoded with the method I mentioned in a
previous post.
 
S

Steven Burn

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,040
Latest member
papereejit

Latest Threads

Top