473,785 Members | 2,841 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ASP Forms "Get" Server Variables

Hi All,

Can anyone clever out there tell me why the below script does not
work!
- I have a page with two radio boxes with values of "agree" and
"not_agree" .
- The form is set to GET which goes to the below script for
processing.
- No matter which of the two radio boxes are selected, it always goes
to the page "/broadband/order.asp".
- There is no other code on the form processing page apart form what
is below.
- PLEASE HELP

Thanks
H
<%
if request.ServerV ariables("terms _conditions") = agree then
response.Redire ct("/broadband/order.asp")
else
response.Redire ct("/default.asp")
end if
%>
Jul 19 '05 #1
5 5276
> if request.ServerV ariables("terms _conditions") = agree then

Did you mean

if request.QuerySt ring("terms_con ditions") = "agree" then
Jul 19 '05 #2
When you use GET with a form you pull values from REquest.Queryst ring, not
REquest.Serverv ariables.

Also, you'll want to delimit agree. Try this:

If Request.Queryst ring("term_cond itions") = "agree" Then
Response.Write "It will redirect to order.asp after I am finished
debugging and add the redirect code."
Else
Response.Write "It will redirect to default.asp after I am finished
debugging and add the redirect code. I will never put redirect code in
until I have my conditional statements working propery so that things are
easier to debug. I will use response.write often while debugging, and I
will also often use response.end."
End If

Ray at work
"Harry" <ha************ @hotmail.com> wrote in message
news:1c******** *************** ***@posting.goo gle.com...
Hi All,

Can anyone clever out there tell me why the below script does not
work!
- I have a page with two radio boxes with values of "agree" and
"not_agree" .
- The form is set to GET which goes to the below script for
processing.
- No matter which of the two radio boxes are selected, it always goes
to the page "/broadband/order.asp".
- There is no other code on the form processing page apart form what
is below.
- PLEASE HELP

Thanks
H
<%
if request.ServerV ariables("terms _conditions") = agree then
response.Redire ct("/broadband/order.asp")
else
response.Redire ct("/default.asp")
end if
%>

Jul 19 '05 #3

Response.Write "It will redirect to default.asp after I am finished
debugging and add the redirect code. I will never put redirect code in
until I have my conditional statements working propery so that things are
easier to debug. I will use response.write often while debugging, and I
will also often use response.end."
Yes Mom.

"Ray at <%=sLocation% >" <myfirstname at lane34 dot com> wrote in message
news:%2******** ********@TK2MSF TNGP12.phx.gbl. ..
When you use GET with a form you pull values from REquest.Queryst ring, not
REquest.Serverv ariables.

Also, you'll want to delimit agree. Try this:

If Request.Queryst ring("term_cond itions") = "agree" Then
Response.Write "It will redirect to order.asp after I am finished
debugging and add the redirect code."
Else
Response.Write "It will redirect to default.asp after I am finished
debugging and add the redirect code. I will never put redirect code in
until I have my conditional statements working propery so that things are
easier to debug. I will use response.write often while debugging, and I
will also often use response.end."
End If

Ray at work
"Harry" <ha************ @hotmail.com> wrote in message
news:1c******** *************** ***@posting.goo gle.com...
Hi All,

Can anyone clever out there tell me why the below script does not
work!
- I have a page with two radio boxes with values of "agree" and
"not_agree" .
- The form is set to GET which goes to the below script for
processing.
- No matter which of the two radio boxes are selected, it always goes
to the page "/broadband/order.asp".
- There is no other code on the form processing page apart form what
is below.
- PLEASE HELP

Thanks
H
<%
if request.ServerV ariables("terms _conditions") = agree then
response.Redire ct("/broadband/order.asp")
else
response.Redire ct("/default.asp")
end if
%>


Jul 19 '05 #4
Uh, Dad.

Ray (not Rae) at work

"Tom B" <sh*****@hotmai l.com> wrote in message
news:el******** ******@TK2MSFTN GP10.phx.gbl...


Yes Mom.

Jul 19 '05 #5
In addition to everything else that has been said, using "Option Explicit"
on every ASP page I write has helped me with things like what you
encountered. It is optional (for some, not to me), but in your case it
would have raised an error that you hadn't defined the variable "agree" (no
quotes), helping you to identify the problem sooner.

(and BTW, I have to add with a grin that "Yes, Mom" was appropriate, because
it was said exactly the way I used to say it to my brother when he was doing
his self-righteous finger-wagging. Has nothing to do with gender or with
the fact that Ray was very right about his effective development practices.)
"Harry" <ha************ @hotmail.com> wrote in message
news:1c******** *************** ***@posting.goo gle.com...
Hi All,

Can anyone clever out there tell me why the below script does not
work!
- I have a page with two radio boxes with values of "agree" and
"not_agree" .
- The form is set to GET which goes to the below script for
processing.
- No matter which of the two radio boxes are selected, it always goes
to the page "/broadband/order.asp".
- There is no other code on the form processing page apart form what
is below.
- PLEASE HELP

Thanks
H
<%
if request.ServerV ariables("terms _conditions") = agree then
response.Redire ct("/broadband/order.asp")
else
response.Redire ct("/default.asp")
end if
%>

Jul 19 '05 #6

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

Similar topics

12
5758
by: Me | last post by:
Hi, I would like learn from people with experience in C++, which of the following styles of way to construct "get/set" member functions would be the best in terms of usability, speed, et cetera. The following class with be used as an example: class MyClass { public: // member function would go here. private: int data_;
5
1903
by: Duck Dodgers | last post by:
Here is my situation class base { }; class child1 { int data; }; class child2 {
9
24974
by: jensen bredal | last post by:
I have a dataView and i only want to get the first x rows . Is there a way of doing this without using Foreach? Thanks JB
2
1977
by: martyn_wynne | last post by:
Hi, I have found a odd one, my submit button is not submitting on a method="get" form after using any form of DataBind? Has anyone struck this problem before? here is snipits of the code as an example <form id="frmUserSearch" method="get" runat="server">
3
1380
by: Agnes | last post by:
My purpose is When the user press "F3" in specified column, i need to put specified data in that column Now, I can get "F3" by using BUT I don't know how to put the data in that textbox, I try Dim xx As DataRow = dtInvCharges.Rows(dgInvCharges.CurrentRowIndex) xx.Item("remark") = "F3 Command process" it returns error.
6
8755
by: James MA | last post by:
I'm now writing a small program to communicate a web server to simulate a web client. I use te httpwebrequest to talk with the server, and it works find for "POST" method, however, when i test other link using "GET" method, i found that the cookies data has not included in the request. Here is the sample: ' sURL is the URL of server page ' pCookies is a varible contain the cookies data
6
2180
by: webonomic | last post by:
"The connection name 'LocalSqlServer' was not found in the applications configuration or the connection string is empty." I get the error above. It tells me the error is in Line 120: <profile> Line 121: <providers> Line 122: <add name="AspNetSqlProfileProvider" connectionStringName="LocalSqlServer" applicationName="/" type="System.Web.Profile.SqlProfileProvider, System.Web, Version=2.0.0.0, Culture=neutral,...
6
4264
by: William | last post by:
for example, I have a global object: extern Object myobj; Can gcc get this object by using string "myobj" at runtime?? I know C++ rtti doesnt support this, but I dont know if gcc can , thanks in advance.
1
3406
by: Jim Carlock | last post by:
Let's not argue about semantics. Let's talk about semasiology. Do specifications exist for using mixed case, upper case, lower case for the contents of the method employed? My own preferences lean towards the all lower-case model, simply because it reads a little easier when deployed with other XHTML semaphorings. --
0
9480
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10330
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10153
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
7500
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6740
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4053
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3654
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2880
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.