Home > Archive > ASP > December 2006 > dim
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
|
|
|
| Hello , I''ve got a problem with "dim".
I want to receive a variable send from a formular with method GET
Why it doesn't work??
<body>
<%
dim name
dim vorname
....
name = request.QueryString("name")
vorname = request.QueryString("vorname")
....
response.write ("name" )
response.write ("vorname" )
....
response.end
%>
</body>
Thanks, pascal
| |
| Evertjan. 2006-12-11, 6:57 pm |
| elia wrote on 07 dec 2006 in microsoft.public.inetserver.asp.general:
> Hello , I''ve got a problem with "dim".
> I want to receive a variable send from a formular with method GET
>
> Why it doesn't work??
>
> <body>
> <%
> dim name
> dim vorname
Unnecessary, if you do not use "option explicit"
[I never do in a small piece of code like this]
> ...
> name = request.QueryString("name")
> vorname = request.QueryString("vorname")
> ...
> response.write ("name" )
> response.write ("vorname" )
You wouldn't want to read "nameforname", I presume.
Better write the content of the variables,
and put something between both:
response.write (name & ", ")
response.write (vorname)
> ...
> response.end
Why that? </body> would not be sent in the html string to the client.
> %>
> </body>
>
> Thanks, pascal
>
>
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
| |
|
| Thanks, ok, in fact my code was more complicate, I tried to simplify
but it was in fact:
a redirection, i receive a variable "txtBAddr3" and if it's One or two
or tree, I send all the variable in other page...
<head>
<%
dim txtTransactionID
dim txtPayMet
dim txtOrderIDShop
dim txtBAddr3
txtTransactionID = request.QueryString("txtTransactionID")
txtPayMet = request.QueryString("txtPayMet")
txtOrderIDShop = request.QueryString("txtOrderIDShop")
txtBAddr3 = request.QueryString("txtBAddr3")
if txtBAddr3 = "One" then
dim StringToSendx
StringToSendx =
"txtTransactionID="&txtTransactionID&"&txtPayMet="&txtPayMet&"&txtOrderIDShop="&txtOrderIDShop
Response.redirect "....x.php?"&StringToSendx
else
if txtBAddr3 = "Two" then
dim StringToSend
StringToSend =
"txtTransactionID="&txtTransactionID&"&txtPayMet="&txtPayMet&"&txtOrderIDShop="&txtOrderIDShop
Response.redirect ".....y.php?"&StringToSend
else
.....
%>
</head>
...but my variable txtBAddr3 is not recognized.... ??
Thanks, pascal
| |
| Evertjan. 2006-12-11, 6:57 pm |
| elia wrote on 07 dec 2006 in microsoft.public.inetserver.asp.general:
> Thanks, ok, in fact my code was more complicate,
Please specify by quoting who and on what you are replying.
Usenet is not email.
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
| |
| Anthony Jones 2006-12-11, 6:57 pm |
|
"elia" <joseph@pcl.ch> wrote in message
news:1165481759.733631.176910@f1g2000cwa.googlegroups.com...
> Thanks, ok, in fact my code was more complicate, I tried to simplify
> but it was in fact:
> a redirection, i receive a variable "txtBAddr3" and if it's One or two
> or tree, I send all the variable in other page...
>
> <head>
> <%
> dim txtTransactionID
> dim txtPayMet
> dim txtOrderIDShop
> dim txtBAddr3
> txtTransactionID = request.QueryString("txtTransactionID")
> txtPayMet = request.QueryString("txtPayMet")
> txtOrderIDShop = request.QueryString("txtOrderIDShop")
> txtBAddr3 = request.QueryString("txtBAddr3")
>
> if txtBAddr3 = "One" then
> dim StringToSendx
> StringToSendx =
>
"txtTransactionID="&txtTransactionID&"&txtPayMet="&txtPayMet&"&txtOrderIDSho
p="&txtOrderIDShop
> Response.redirect "....x.php?"&StringToSendx
>
> else
>
> if txtBAddr3 = "Two" then
> dim StringToSend
> StringToSend =
>
"txtTransactionID="&txtTransactionID&"&txtPayMet="&txtPayMet&"&txtOrderIDSho
p="&txtOrderIDShop
> Response.redirect ".....y.php?"&StringToSend
>
> else
> ....
> %>
> </head>
>
> ..but my variable txtBAddr3 is not recognized.... ??
Do you get an error saying 'variable not recognized'?? You need to be more
specific.
Are you getting an error or is the code not behaving as you would expect?
If error specify the error.
If mis-behaving specify what input you are giving it, what outcome you
expected and what outcome you are actually getting.
BTW if the querystring contains txtBAddr3=one then:
if txtBAddr3 = "One" then
will not match since it is case sensitive.
I tend to use code like this for retrieving querystring variables that are
case insensitive identifiers:-
Dim sBAddr3 : sBAddr3 = LCase(Request.QueryString("txtBAddr3"))
BTW you should include always include an Option Explicit in the top of your
script.
>
> Thanks, pascal
>
| |
|
| Ok, thanks, I find my error, with my first example:
I have to write :
dim txtTransactionID : txtTransactionID =
request.QueryString("txtTransactionID")
response.write txtTransactionID
and not
dim txtTransactionID : txtTransactionID =
request.QueryString("txtTransactionID")
response.write ("txtTransactionID")
Thanks for your help. It's ok now. pascal
|
|
|
|
|