|
Home > Archive > IIS ASP > June 2006 > Separating out concatenated values in Request.Form
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]
| Author |
Separating out concatenated values in Request.Form
|
|
| eric.goforth@gmail.com 2006-06-22, 1:26 pm |
| Hello,
I'm working with a classic asp page that calls another classic asp
page. The html in my calling page looks like:
<form method="post"
action="/includes/mypage2.asp?subtype=MyType&ecd=1&eid=97702">
....Do some stuff
<input type="submit" name="btnSubmit" value="MyType">
<input type="hidden" name="PageName" value="/includes/mypage1.asp">
<input type="hidden" name="UrlParms"
value="ID1=97702&ID2=2235"></td>
</form>
Now debugging in Interdev inside the mypage2.asp
I see:
Request.Form("UrlParms") = "ID1=97702&ID2=2235"
Is there any way to easily separate out the ID2? If it was in the
Querystring I could simply do a:
Request.QueryString("ID2")
Thanks,
Eric
| |
| James Jones 2006-06-22, 1:26 pm |
| what you mean you want to seperate them? if you want them seprate, then
combined try this............
ID1 = Request.QueryString("ID1")
ID2 = Request.QueryString("ID2")
UrlParms = ID1 & "&" & ID2
that separates them so you can use each indvidually, then recombine them
after defning.............im not 100% sure what ur asking, so hope this
helps.
Jay
<eric.goforth@gmail.com> wrote in message
news:1150986874.365119.45340@g10g2000cwb.googlegroups.com...
> Hello,
>
> I'm working with a classic asp page that calls another classic asp
> page. The html in my calling page looks like:
>
>
> <form method="post"
> action="/includes/mypage2.asp?subtype=MyType&ecd=1&eid=97702">
>
> ...Do some stuff
>
> <input type="submit" name="btnSubmit" value="MyType">
> <input type="hidden" name="PageName" value="/includes/mypage1.asp">
> <input type="hidden" name="UrlParms"
> value="ID1=97702&ID2=2235"></td>
>
> </form>
>
> Now debugging in Interdev inside the mypage2.asp
>
> I see:
>
> Request.Form("UrlParms") = "ID1=97702&ID2=2235"
>
> Is there any way to easily separate out the ID2? If it was in the
> Querystring I could simply do a:
>
> Request.QueryString("ID2")
>
> Thanks,
> Eric
>
| |
| eric.goforth@gmail.com 2006-06-22, 1:26 pm |
| James,
In mypage2.asp I'd like to get the value of ID2, but ID2 isn't in my
query string. It's a hidden control on mypage1.asp that's storing a
concatenated string "ID1=97702&ID2=2235"
In mypage2.asp, I see: Request.Form("UrlParms") = "ID1=97702&ID2=2235"
I can use string manipulation functions to split them, like a Mid() or
Split() (I'd need to double check what I can do in classic asp), but I
wondered if there was a built-in way to do this.
For instance, if "ID1=97702&ID2=2235" was in my query string I could do
Request.QueryString("ID2").
Thanks,
Eric
James Jones wrote:[vbcol=seagreen]
> what you mean you want to seperate them? if you want them seprate, then
> combined try this............
>
>
> ID1 = Request.QueryString("ID1")
> ID2 = Request.QueryString("ID2")
> UrlParms = ID1 & "&" & ID2
>
>
> that separates them so you can use each indvidually, then recombine them
> after defning.............im not 100% sure what ur asking, so hope this
> helps.
>
>
>
> Jay
>
>
>
>
>
>
> <eric.goforth@gmail.com> wrote in message
> news:1150986874.365119.45340@g10g2000cwb.googlegroups.com...
| |
| Bob Barrows [MVP] 2006-06-22, 1:26 pm |
| eric.goforth@gmail.com wrote:
> Hello,
>
> I'm working with a classic asp page that calls another classic asp
> page. The html in my calling page looks like:
>
>
> <form method="post"
> action="/includes/mypage2.asp?subtype=MyType&ecd=1&eid=97702">
>
> ...Do some stuff
>
> <input type="submit" name="btnSubmit" value="MyType">
> <input type="hidden" name="PageName" value="/includes/mypage1.asp">
> <input type="hidden" name="UrlParms"
> value="ID1=97702&ID2=2235"></td>
If you think you are providing some sort of security by doing this, then
think again.
>
> </form>
>
> Now debugging in Interdev inside the mypage2.asp
>
> I see:
>
> Request.Form("UrlParms") = "ID1=97702&ID2=2235"
>
> Is there any way to easily separate out the ID2? If it was in the
> Querystring I could simply do a:
>
> Request.QueryString("ID2")
>
dim ar,arid2,id2
ar=split(Request.Form("UrlParms"),"&")
arid2=Split(ar(1),"=")
id2=arid2(1)
You'll need to supply some error-handling as well as some checks that
the arrays that result from the split method contain the expected number
of elements.
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
| |
| James Jones 2006-06-22, 1:26 pm |
| you cant split the string in mypage1.asp?
<eric.goforth@gmail.com> wrote in message
news:1150987921.910967.171030@u72g2000cwu.googlegroups.com...
> James,
>
> In mypage2.asp I'd like to get the value of ID2, but ID2 isn't in my
> query string. It's a hidden control on mypage1.asp that's storing a
> concatenated string "ID1=97702&ID2=2235"
>
> In mypage2.asp, I see: Request.Form("UrlParms") = "ID1=97702&ID2=2235"
>
> I can use string manipulation functions to split them, like a Mid() or
> Split() (I'd need to double check what I can do in classic asp), but I
> wondered if there was a built-in way to do this.
>
> For instance, if "ID1=97702&ID2=2235" was in my query string I could do
> Request.QueryString("ID2").
>
> Thanks,
> Eric
>
> James Jones wrote:
>
| |
| James Jones 2006-06-22, 1:26 pm |
| lol listen to bob..........hes a pro, not me, lol
"James Jones" <jamisonburrous08@insightbb.com> wrote in message
news:OPDD7wglGHA.3304@TK2MSFTNGP03.phx.gbl...
> you cant split the string in mypage1.asp?
>
>
>
>
> <eric.goforth@gmail.com> wrote in message
> news:1150987921.910967.171030@u72g2000cwu.googlegroups.com...
>
>
| |
| eric.goforth@gmail.com 2006-06-22, 1:26 pm |
| Hello,
I guess that I'll have to do a split then. I'm working in a pretty big
classic asp application. For some new functionality, I need to get the
value of ID2 in mypage2.asp. The code concatenating ID1 and ID2 in the
URLparams hidden variable in mypage1.asp was already there. I'd rather
not change it, since I don't want to risk breaking something else.
-Eric
Bob Barrows [MVP] wrote:
> eric.goforth@gmail.com wrote:
>
> If you think you are providing some sort of security by doing this, then
> think again.
>
>
> dim ar,arid2,id2
> ar=split(Request.Form("UrlParms"),"&")
> arid2=Split(ar(1),"=")
> id2=arid2(1)
>
> You'll need to supply some error-handling as well as some checks that
> the arrays that result from the split method contain the expected number
> of elements.
>
> --
> Microsoft MVP -- ASP/ASP.NET
> Please reply to the newsgroup. The email account listed in my From
> header is my spam trap, so I don't check it very often. You will get a
> quicker response by posting to the newsgroup.
| |
| Evertjan. 2006-06-22, 1:26 pm |
| wrote on 22 jun 2006 in microsoft.public.inetserver.asp.general:
> James Jones wrote:
[please do not toppost on usenet]
[vbcol=seagreen]
> In mypage2.asp I'd like to get the value of ID2, but ID2 isn't in my
> query string. It's a hidden control on mypage1.asp that's storing a
> concatenated string "ID1=97702&ID2=2235"
>
> In mypage2.asp, I see: Request.Form("UrlParms") = "ID1=97702&ID2=2235"
>
> I can use string manipulation functions to split them, like a Mid() or
> Split() (I'd need to double check what I can do in classic asp), but I
> wondered if there was a built-in way to do this.
>
> For instance, if "ID1=97702&ID2=2235" was in my query string I could
> do Request.QueryString("ID2").
try:
result = myRequestform("UrlParms","ID2")
function myRequestform(a,b)
temp = "&" & Request.Form(a) & "&"
n = instr(temp,"&"&b&"=")
if n=0 then myRequestform ="":exit function
n = n + len("&"&b&"=")
temp = mid(temp,n)
n = instr(temp,"&")-1
myRequestform = left(temp,n)
end function
partly tested
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
|
|
|
|
|