473,322 Members | 1,314 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

GET and form data

I have this code...

If Request.Form("Name") = "" Then
Response.Redirect "error.asp"
End if

If the browser does a GET against this page, sometimes the Response.Redirect
doesn't happen. It is as if there is form data being sent on a GET.

Has anyone seen this before?

Jonathan

Jul 22 '05 #1
5 1263
You need to use Request.Querystring for GET requests...... and Request.Form for POST requests.

If Request.Form("Name") = "" AND Request.Querystring("Name") = "" Then
Response.Redirect "error.asp"
End if

--

Regards

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

Keeping it FREE!

"Jonathan Allen" <x@x.x> wrote in message news:u8**************@tk2msftngp13.phx.gbl...
| I have this code...
|
| If Request.Form("Name") = "" Then
| Response.Redirect "error.asp"
| End if
|
| If the browser does a GET against this page, sometimes the Response.Redirect
| doesn't happen. It is as if there is form data being sent on a GET.
|
| Has anyone seen this before?
|
| Jonathan
|
|
|
Jul 22 '05 #2
Yes, we all know what SHOULD be happening. But in reality, something strange
is going on.

Is there any combination of browser, OS, phase of the moon, that would cause
a GET request to have form data? Or at least make IIS think there is form
data?

Jonathan
"Steven Burn" <so*******@in-time.invalid> wrote in message
news:u5**************@TK2MSFTNGP09.phx.gbl...
You need to use Request.Querystring for GET requests...... and
Request.Form for POST requests.

If Request.Form("Name") = "" AND Request.Querystring("Name") = "" Then
Response.Redirect "error.asp"
End if

--

Regards

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

Keeping it FREE!

"Jonathan Allen" <x@x.x> wrote in message
news:u8**************@tk2msftngp13.phx.gbl...
| I have this code...
|
| If Request.Form("Name") = "" Then
| Response.Redirect "error.asp"
| End if
|
| If the browser does a GET against this page, sometimes the
Response.Redirect
| doesn't happen. It is as if there is form data being sent on a GET.
|
| Has anyone seen this before?
|
| Jonathan
|
|
|

Jul 22 '05 #3
Jonathan Allen wrote on 24 jan 2005 in
microsoft.public.inetserver.asp.general:
| If Request.Form("Name") = "" Then
| Response.Redirect "error.asp"
| End if Yes, we all know what SHOULD be happening. But in reality, something
strange is going on.

Is there any combination of browser, OS, phase of the moon, that would
cause a GET request to have form data? Or at least make IIS think
there is form data?


I think:

Response redirect gives a header request to the browser to redirect.
so the GET is browser dependent.

Could you try a GET of:

application("noformname")="no"
If Request.Form("Name") = "" Then
application("noformname")="yes"
End if

[and thest for that application variable in another asp-file]

and seperate a GET of just:

Response.Redirect "error.asp"
--
Evertjan.
The Netherlands.
(Replace all crosses with dots in my emailaddress)

Jul 22 '05 #4
Jonathan Allen wrote:
If Request.Form("Name") = "" Then
Response.Redirect "error.asp"
End if

If the browser does a GET against this page, sometimes the
Response.Redirect doesn't happen. It is as if there is form data
being sent on a GET.


Since Request.Form("Name") is an OBJECT with properties other than string
values, I am never surprised to see "unexpected" behavior when comparing it
to a string. Alternatives to consider:

• If Request.Form("Name").Count = 0 Then...
• If Request.Form("Name").Item = "" Then...
• If Request.Form("Name").Item = "" And
Request.QueryString("Name").Item = "" Then...
--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms. Please do not contact
me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting.
Jul 22 '05 #5
> Response redirect gives a header request to the browser to redirect.
so the GET is browser dependent.

True, but it looks like my users are using Win95/98 and IE. Also, a
Response.Redirect halts the execution of the script, so there shouldn't be
any way to continue even if the browser gets confused.

Jonathan

"Evertjan." <ex**************@interxnl.net> wrote in message
news:Xn********************@194.109.133.29... Jonathan Allen wrote on 24 jan 2005 in
microsoft.public.inetserver.asp.general:
| If Request.Form("Name") = "" Then
| Response.Redirect "error.asp"
| End if

Yes, we all know what SHOULD be happening. But in reality, something
strange is going on.

Is there any combination of browser, OS, phase of the moon, that would
cause a GET request to have form data? Or at least make IIS think
there is form data?


I think:

Response redirect gives a header request to the browser to redirect.
so the GET is browser dependent.

Could you try a GET of:

application("noformname")="no"
If Request.Form("Name") = "" Then
application("noformname")="yes"
End if

[and thest for that application variable in another asp-file]

and seperate a GET of just:

Response.Redirect "error.asp"
--
Evertjan.
The Netherlands.
(Replace all crosses with dots in my emailaddress)

Jul 22 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Gregory A Greenman | last post by:
I'm trying to write a program in vb.net to automate filling out a series of forms on a website. There are three forms I need to fill out in sequence. The first one is urlencoded. My program is...
16
by: Philippe C. Martin | last post by:
Hi, I am trying to change the data in a form field from python. The following code does not crash but has no effect as if "form" is just a copy of the original html form. Must I recreate the...
15
by: Steve | last post by:
I have a form with about 25 fields. In the BeforeUpdate event of the form, I have code that sets the default value of each field to its current value. For a new record, I can put the focus in any...
11
by: Johnny | last post by:
I'm a rookie at C# and OO so please don't laugh! I have a form (fclsTaxCalculator) that contains a text box (tboxZipCode) containing a zip code. The user can enter a zip code in the text box and...
8
by: Johnny | last post by:
I'm a rookie at C# and OO so please don't laugh! I have a form (fclsTaxCalculator) that contains a text box (tboxZipCode) containing a zip code. The user can enter a zip code in the text box and...
4
by: Alex Sibilev | last post by:
Hello, I have a really weird problem I've been trying to solve it without any luck for the last couple of hours :( I'm writing a "conference board" application (quite similar to ASP.NET...
15
by: http://www.visual-basic-data-mining.net/forum | last post by:
Does anyone have any idea how to transferring data from TextBox1 in form1 to textBox2 in form2..... That means after i fill in any data in textBox1 and click Next button... It will bring me to...
8
by: hoofbeats95 | last post by:
I don't think this should be this complicated, but I can't figure it out. I've worked with C# for several years now, but in a web environment, not with windows form. I have a form with a query...
22
by: Zytan | last post by:
I have public methods in a form. The main form calls them, to update that form's display. This form is like a real-time view of data that is changing. But, the form may not exist (it is...
9
by: RvGrah | last post by:
I'm completely new to using background threading, though I have downloaded and run through several samples and understood how they worked. My question is: I have an app whose primary form...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.