assigning request variables

assigning request variables

Post by John Smit » Wed, 14 Jan 2004 17:09:45


Hi all,

Not too sure if this is the right group as I am currently migrating some
scripts over from my native language php to my little known VBscript.

So appologise for dumb questions.

Firstly, is there anyway to set a request value with vbscript?

for example, when i do ...
if request.QueryString("key") = "" then
request.QueryString("key") = "value"
end if

I get an error

This can be done quite easily using php (not judging or comparing) and I was
just wondering if it is at all possible with vbscript, asp or any IIS
technology?

Also, I have looked thoroughly through the microsoft Developers site and
searched for hours with no luck. So any light on the subject would be
fantastic.

Thanks in advance

Tracy
 
 
 

assigning request variables

Post by Roland Hal » Wed, 14 Jan 2004 20:59:58


: for example, when i do ...
: if request.QueryString("key") = "" then
: request.QueryString("key") = "value"
: end if
:
: I get an error

Response to set, Request to retrieve. You cannot set a value of anything
using Request in ASP.

Values set:
http://www.yqcomputer.com/

Values not set:
http://www.yqcomputer.com/

--
Roland

This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose.
-Technet Knowledge Base-
http://www.yqcomputer.com/ ;EN-US;kbhowto&sd=TECH&ln=EN-US&FR=0
-Technet Script Center-
http://www.yqcomputer.com/
-MSDN Library-
http://www.yqcomputer.com/

 
 
 

assigning request variables

Post by John Smit » Wed, 14 Jan 2004 21:23:52

Thanks Roland,

Your answer and script explains perfectly. Onwards I plunge.
Now my mind wanders to "search engine friendly urls". Any ideas on rewriting
the url?

eg.
http://www.yqcomputer.com/

displays as...
http://www.yqcomputer.com/

(".htm") being the fake extension

I will also have a look around and post if I have any luck.

Thanks

T



http://www.yqcomputer.com/ ;EN-US;kbhowto&sd=TECH&ln=EN-US&FR=0
http://www.yqcomputer.com/
 
 
 

assigning request variables

Post by Roland Hal » Wed, 14 Jan 2004 23:18:06


: Thanks Roland,
You're welcome.

: Your answer and script explains perfectly. Onwards I plunge.
: Now my mind wanders to "search engine friendly urls". Any ideas on
rewriting
: the url?
:
: eg.
: http://www.yqcomputer.com/
:
: displays as...
: http://www.yqcomputer.com/
:
: (".htm") being the fake extension

At the bottom of the pages I wrote, is a View Source link to see the ASP
code. However, I found a link tonight that will explain it to you better
probably better than the comments in my source. He's using a database with
it but you could just as easily do it with an XML document.

http://www.yqcomputer.com/

--
Roland

This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose.
-Technet Knowledge Base-
http://www.yqcomputer.com/ ;EN-US;kbhowto&sd=TECH&ln=EN-US&FR=0
-Technet Script Center-
http://www.yqcomputer.com/
-MSDN Library-
http://www.yqcomputer.com/
 
 
 

assigning request variables

Post by Roland Hal » Wed, 14 Jan 2004 23:26:43

What I probably should have explained is the links do what you requested.

The link with no querystring assigns two default variables. The other does
nothing. Also, you could add as many as allowed on the URL line and it
would display them on the page to show you they're being parsed correctly.

http://www.yqcomputer.com/

--
Roland

This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose.
-Technet Knowledge Base-
http://www.yqcomputer.com/ ;EN-US;kbhowto&sd=TECH&ln=EN-US&FR=0
-Technet Script Center-
http://www.yqcomputer.com/
-MSDN Library-
http://www.yqcomputer.com/
 
 
 

assigning request variables

Post by John Smit » Thu, 15 Jan 2004 07:48:09

Roland,

Your script was clear to me and more suited to what I was required to do. So
thanks.

My research so far shows that to do a "friendly url" as mentioned earlier in
the thread, you either require a 3rd party application ($$$) for IIS or a
custom 404 error message to handle the re-written url.
My problem here is that I am working with a standard remote server where I
have no access to the IIS console.
Is there a way to administer custom error messages via a script in asp?

Thanks for any suggestions. Again, my research on the matter so far remains
fruitless.

T



does
 
 
 

assigning request variables

Post by Roland Hal » Fri, 16 Jan 2004 18:39:26


: Is there a way to administer custom error messages via a script in asp?

Are you referring to customizing the IIS error message documents, i.e. 404?
If so, I believe you would need rights to access those pages. I'm surprised
that you do not have rights to make administrative changes but given this
task to complete. Am I misunderstanding what you're saying?

--
Roland

This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose.
-Technet Knowledge Base-
http://www.yqcomputer.com/ ;EN-US;kbhowto&sd=TECH&ln=EN-US&FR=0
-Technet Script Center-
http://www.yqcomputer.com/
-MSDN Library-
http://www.yqcomputer.com/