dim

dim

am 07.12.2006 09:12:53 von Elia

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??


<%
dim name
dim vorname
....
name = request.QueryString("name")
vorname = request.QueryString("vorname")
....
response.write ("name" )
response.write ("vorname" )
....
response.end
%>


Thanks, pascal

Re: dim

am 07.12.2006 09:38:13 von exjxw.hannivoort

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??
>
>
> <%
> 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? would not be sent in the html string to the client.

> %>
>
>
> Thanks, pascal
>
>



--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

Re: dim

am 07.12.2006 09:55:59 von Elia

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...


<%
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
.....
%>


...but my variable txtBAddr3 is not recognized.... ??

Thanks, pascal

Re: dim

am 07.12.2006 10:00:07 von exjxw.hannivoort

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)

Re: dim

am 07.12.2006 10:35:58 von Anthony Jones

"elia" 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...
>
>
> <%
> 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
> ....
> %>
>
>
> ..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
>

Re: dim

am 07.12.2006 11:46:40 von Elia

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