Welcome, Guest ( Customer Panel | Login )




 All Forums
 VPCart Forum
 Customization
 Request function
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

escort
Starting Member

32 Posts

Posted - July 24 2007 :  10:40:24  Show Profile  Reply with Quote
I see call to Request function in some of the .asp files.
strAction=Request("Continue")

I am customizing my shopping cart and I would like to use this function but I can't figure out if it is part of the vp-asp since I can't find that function definition. Any help in this will be appreciated . Thanks

devshb
Senior Member

United Kingdom
1904 Posts

Posted - July 24 2007 :  15:04:25  Show Profile  Visit devshb's Homepage  Reply with Quote
it's a standard vbscript function (ie not a vpasp function)
it's used to find out what an argument or field value is, or what button has just been pressed when submitting the form.

you can also use:

request.form("myfieldname")
(to specifically find out what a field's value was upon form submission/posting)

or
request.querystring("myargument")
(to specifically find out what an argument was in the url)

the general request("myname") function will fall-through, checking that name's value for arguments and fields.

for form submissions, when checking if a certain buttons was pressed, it is uses "name" and "name.x" on the checks, because when using image buttons for some weird reason the request object also needs a ".x" on the end of the name being requested. so, the bit with the "continue" checks in it is checking to see which button has just been pressed and to see if the form has just been submitted or if it's just been opened for the first time.

if your form only has one submit button on it, or if you only want to find out whether the form has been submitted or loaded for the first time, then you can use a server variable instead, ie:

if (Request.ServerVariables("REQUEST_METHOD")="POST") then
the form has just been submitted, now process it, using request("myfieldname") or request.form("myfieldname") etc to find what the values were
else
the screen has been opened but not submitted so just setup the default variables etc, or use request("myargumentname") or request.querystring("myargumentname") etc to find out what the querystrings were to the url (if any)
end if
now show the form

if you're delving into the asp side of things, then here's a fantastic link, a kind of online manual which explains with examples all the standard functions, definitely not a thing that's only for newbies; I use it all the time too, it's a really great reference manual and explains all the potential weirdnesses and syntax of the various functions:

VBScript Language Reference Manual:
http://msdn2.microsoft.com/en-us/library/d1wf56tt.aspx

(don't bother using the search function on that manual though because it'll just search the whole microsoft reference library; instead just drill-down on the functions/statements links etc on the left-panel; but watch out; that url only works properly on internet explorer, if you try it on netscape etc you end up with nested windows or errors each time you click on something)

annoyingly, for some strange reason, microsoft have put the request help outside that manual and put it into their iis manual instead:
http://msdn2.microsoft.com/en-us/library/ms524948.aspx

Simon Barnaby
Developer
[email protected]
www.BigYellowZone.com
Web Design, Online Marketing and VPASP addons

Edited by - devshb on July 24 2007 15:35:55
Go to Top of Page

escort
Starting Member

32 Posts

Posted - July 24 2007 :  16:11:03  Show Profile  Reply with Quote
Thank you very much Simon. This helps a lot.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Snitz Forums 2000
0 Item(s)
$0.00