Get ready for BLACK FRIDAY shopping starting in

Forums

This topic is locked

Request or Request.Form?

Posted 17 Sep 2001 14:25:36
1
has voted
17 Sep 2001 14:25:36 Nam Lee posted:
Hello Everybody.

when do i use Request and Request.Form?? Sometimes i
seen writers and authors interchange These 2 quite occasionally.

Another question is how come sometimes there is an ampersand in front of the
Request??
for example,

select * from table where products.occasion_id = &Request("occasion"

The "occasion" is a field name by the way. Does having an ampersand means to
retrive the information inside the "occasion" text box within the same
page??
Thanks!


Replies

Replied 18 Sep 2001 14:42:01
18 Sep 2001 14:42:01 Joel Martinez replied:
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>when do i use Request and Request.Form?? Sometimes i
seen writers and authors interchange These 2 quite occasionally.<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>They are somewhat the same... request.form, only checks the form collection... request checks the form, querystring, and servervariables collection.
some argue that it's better for performance to specify which collection you want (ie. request.querystring("var" instead of request("var")

<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>Another question is how come sometimes there is an ampersand in front of the
Request??
for example,

select * from table where products.occasion_id = &Request("occasion"

The "occasion" is a field name by the way. Does having an ampersand means to
retrive the information inside the "occasion" text box within the same
page??
Thanks!<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>Hmm, I belive that you've seen that code within the recordset builder in UD... that code is translated somewhat to something else in the real code. it would end up looking like this:

mm_SQLvariable = "select * from table where products.occasion_id =" & Request("occasion"

the reason for the & is to "Contantenate" (if I spelled that right) the value of the Request("occasion" to the rest of the SQL string...

hope that helps

Joel Martinez [ ]
----------
E-Commerce Concepts with Ultradev...pre-order yours at
www.basic-ultradev.com/ecomm_concepts/
Replied 19 Sep 2001 18:39:41
19 Sep 2001 18:39:41 Nam Lee replied:
Thanks a lot Joel!
Thata a lot of help!

Reply to this topic