Print Page | Close Window

Request.Form / Request

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=3225
Printed Date: 29 March 2026 at 4:41am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Request.Form / Request
Posted By: Gary
Subject: Request.Form / Request
Date Posted: 03 June 2003 at 4:26am

Ok, so both will do the same thing, but why not always just use Request on its own rather than specifying form or querystring ???




Replies:
Posted By: farrukh
Date Posted: 03 June 2003 at 5:43am
they worked same but there is a difference when we are using querystring after submitting the forum user can see the details from the header for instance if we user login to this discussion forums through querystring then he can see the password from the header. the only thing is a drawback in querystring but one fine thing is that querystring is fast in process while using form. if you use some softwares to encrypt the header then u may always user querystring.

so just Request.Form or Replace.QueryString is not replace by only Request because the taste of users. If they want request.querystring to use they can and if they want form they can.. So its up to them.... so i think it cant be Request ONly..........

-------------
i have collected some nice avatars (37) and smileys (227) here you can download
http://www24.brinkster.com/webmastertool/download.html


Posted By: Gary
Date Posted: 03 June 2003 at 6:29am

Hmmm, the question isn't regarding whether to use .Form or .Querystring, it's more to do with the Request itself.....

Why not just use Request on it's own as it will pick up the form's data no matter which Method you use (Get / Post) ???

BTW - One big advantage of using get/querystring is that users can bookmark the page as it contains the required querystring data. If the page needs to use data from post/form then it will not work with bookmarks.



Posted By: Scotty32
Date Posted: 03 June 2003 at 7:33am

well it depends how big your form is... to if the "get" is best

also, i think its if you have to use the querystring AND the form

then it wont know which to get it from



Posted By: Gary
Date Posted: 03 June 2003 at 7:43am

A form must use either POST or GET - there is no way that a form can submit with both methods.

So, maybe third time lucky (I will re-phrase the question).....

WHY NOT JUST USE REQUEST INSTEAD OF REQUEST.FORM OR REQUEST.QUERYSTRING ????

There must be some reason for this? Please, please, please - no second guessing. If you do not understand the question then do not reply.

Sorry to be so blunt.



Posted By: MorningZ
Date Posted: 03 June 2003 at 8:38am

then why dont you just bloody use it instead of being a prick about it??

the "Request" method is a generic method to get information from either the QuesyString or the Form....

Some people like to be explicit about where the information is coming from and also wish to avoid the possibilty of having both ThisParm in the QueryString AND ThisParam as a posted form field.....

For instance.. version 6 of this forum when you make a new post has a URL like:
http://www.thissite.net/forum/post_message_form.asp?mode=new&ReturnPage=Thread&ForumID=8&TopicID=44933 - http://www.thissite.net/forum/post_message_form.asp?mode=new&ReturnPage=Thread&ForumID=8&TopicID=44933

But on the page generation it also creates a hidden form field called, yup, ForumID
<input type="hidden" name="ForumID" value="8">

Now on postback, if you used just "Request", it'll pull from the URL line first i believe and use that value..... (which is right there for someone to change, say i wanted to "hack" a thread into a protected forum, i could just changed the "8" to the ForumID of the forum i didnt have access to)....  so by explicitly using "Request.Form("ForumID")" the code is pulling from the "hidden" (read: not as easily changable) instead



-------------
Contribute to the working anarchy we fondly call the Internet


Posted By: Scotty32
Date Posted: 03 June 2003 at 8:39am

i think its higher sercerity

becose if you have a page that you want to request from a FORM

then a user could just type in, in the address bar

"page.asp?username=bob"

and how would you know if to use the FORM or the QUERYSTRING

also like i said, you might want to use both!



Posted By: Gary
Date Posted: 03 June 2003 at 9:16am

Morningz,

There is no need to be offensive like that !!!
I could be equally offensive in return, but choose not to do so as it gets us no where.

As a matter of fact, YOU, yes YOU MORNINGZ have missed a few crucial points which I have been advised of since my last post.......

1. Uniqueness
Without specifying what Request needs to search, it will look through not only QueryString and Form, but also Cookies, ClientCertificate and ServerVariables. If there are duplicate names in any of these, then the Request could potentially fail or return the wrong result

2 Performance
With the above in mind, if again you do not specify the 'holder', asp will need to go through each and every object until found.

So, after all, there was a good point to my post. My question was a valid one and I was right to repeat the question 2 or 3 times, although the answer came from elsewhere.

I could have just forgotten about this thread and got on with my work, but no, I thought that the answer was worth sharing with anyone that it may apply to.

 



Posted By: MorningZ
Date Posted: 03 June 2003 at 9:26am

your question was answered a few times already

people specify (and should) "where" the value comes where they expect it from: URL line, Posted form field, cookie, servervariables

instead of (poorly) coding something that potentially will give your application the dead wrong value......

it's all a matter of programming style.. you can use Request if you want, but you'll make debugging your problems that much harder and good luck to someone trying to pick up on the code trail

i have zero idea why that seems so complicated to you.....



-------------
Contribute to the working anarchy we fondly call the Internet


Posted By: Gary
Date Posted: 03 June 2003 at 9:36am

Not complicated at all - its just that the answers did not tell me anything that I didn't already know.

Sure, I could just use 'request' on it's own from now on, but as I start doing more and more complex things with asp it could come back to haunt me.

Please show me anywhere in the answers anything that relates to the likes of Cookies, ClientCertificates, ServerVariables, performance, etc and I will eat 'humble pie'.

Yes, if I had asked what the difference between POST & GET / FORM & QUERYSTRING, then the above answers would be more than sufficient.



Posted By: ljamal
Date Posted: 03 June 2003 at 9:45am
I only use Request over Request.Form or Request.Querystring, if I expect the information to come from either the Form or the querystring. Otherwise, I will use the specific over the general. I first started using the specific because I had field called URL and when left blank in the querystring or the form, it pulls the value from the servervariables.

Ther may be a performance hit to using request, but it does search querystring and then form, so if you are sure that the value is in one or the other, it's not a big performance hit.

-------------
L. Jamal Walton

http://www.ljamal.com/" rel="nofollow - L. Jamal Inc : Web/ Print Design and ASP Programming


Posted By: Gary
Date Posted: 03 June 2003 at 9:51am

Thanks ljamal - some proof that things can go wrong with 'Request' if you're not careful (re: requesting url).

And that is exactly my point !!!

Maybe if you're the only person working on a small-reasonable sized site, 'Request' will suffice. But in my case, where I work for one of the world's largest software companies developing massive sites/apps that manage the likes of our global distribution, then this 'exetended' knowledge is of great benefit.

 



Posted By: Scotty32
Date Posted: 03 June 2003 at 10:47am
Originally posted by Gary Gary wrote:

Ok, so both will do the same thing, but why not always just use Request on its own rather than specifying form or querystring ???

and we're all ment to know EXACTLY wot you mean?



Posted By: Gary
Date Posted: 03 June 2003 at 1:27pm

Not at all Scotty - you're not all supposed to know exactly what I mean.....

This was obviously quite an advanced question that was not answered completely (within this forum). Don't get me wrong, I am not belittling or offending anyone. I merely responded to the suggesting answers, saying that they were not what I was after.

So what do you do when you ask a question and the answers that are submitted do not meet you needs? Simple, you ask again and try rephrasing the question. At least I have not started multiple threads for the same question (unlike some on this board).

 



Posted By: ultramods
Date Posted: 03 June 2003 at 1:38pm
Originally posted by Gary Gary wrote:

WHY NOT JUST USE REQUEST INSTEAD OF REQUEST.FORM OR REQUEST.QUERYSTRING ????

There must be some reason for this? Please, please, please - no second guessing. If you do not understand the question then do not reply.

The way in which you rephrased your question may have put people of helping you in the future, in case they are not 100% certain that their answer it is correct. You may not mind that. But what if his or her answer is correct, and no one else posts an answer?



Posted By: Gary
Date Posted: 03 June 2003 at 2:28pm

Valid point Ultramods - I thought exactly that as the thread continued.

Having said that, there was no need for some of the comments (or rather abuse) posted further up the thread.

The problem is that the board covers all abilities from beginner right through advanced coders and sometimes it can be difficult to gauge just how deep some people (me included) want to go.

Although when you quoted one of my posts, you didn't include my 'apology' at the end. I have never been offensive on here and do not intend to be. Yet I could have easilt been drawn into a slanging match!!!



Posted By: ultramods
Date Posted: 03 June 2003 at 2:37pm

That was either my artistic licence or my delete key didn't work 100% when editing the quote.



Posted By: Gary
Date Posted: 03 June 2003 at 2:42pm

You complete ******

BTW - When are you going to add some content to your site ???



Posted By: ultramods
Date Posted: 03 June 2003 at 2:47pm
There is a lot of content (scattered around different testing servers) Two of us have been working on it for about 40 hours a week since late last year, we think/hope it will be finished in December this year.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net