submit variable names

sourceone
Posts: 47
Joined: Tue Mar 29, 2005 2:10 pm

submit variable names

Post by sourceone »

For the submit function, how can I make the variables names a variable? For example, in the following call, can I make the name of var1 a variable?

<submit URL="http://www.sample.com/login.htm" var1=$var1value>
User avatar
John
Site Admin
Posts: 2623
Joined: Mon Apr 24, 2000 3:18 pm
Location: Cleveland, OH

submit variable names

Post by John »

You can just use a variable:

<submit URL=$url $var1name=$var1value>
John Turnbull
Thunderstone Software
nduvnjak
Posts: 40
Joined: Wed Feb 06, 2008 3:45 pm

submit variable names

Post by nduvnjak »

this is great, but can we use multi-value variables?

example:

<$viewstateparam='...data...'>
<$eventvalparam='...data...'>
<$parameters='__EVENTTARGET'
'__EVENTARGUMENT'
'__VIEWSTATE'
'__EVENTVALIDATION'
'__VIEWSTATEENCRYPTED'>
<$values=
"ctl00$$ctl00$$uxMainContent$$uxMiddleColumn$$uxPagerBottom"
'2'
$viewstateparam
$eventvalparam
''>
<submit METHOD=POST URL='https://something.com/page.aspx' $parameters=$values>


doesn't seem to work for me, but maybe I'm missing something?

thanks,
Nenad
User avatar
mark
Site Admin
Posts: 5519
Joined: Tue Apr 25, 2000 6:56 pm

submit variable names

Post by mark »

Any individual parameter will accept a list and will result in param=value1 param=value2 etc. being sent. But you can't use a list for the parameters themselves.

If you want to build up the post fully abstractly you can build the complete dataset and use the DATA parameter to submit. Format for POST data would be
param1=value1&param2=value2
with values being URL escaped (%U). Don't forget to set CONTENT-TYPE=application/x-www-form-urlencoded" in that case.
nduvnjak
Posts: 40
Joined: Wed Feb 06, 2008 3:45 pm

submit variable names

Post by nduvnjak »

thanks a lot!