|
it
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Separating out concatenated values in Request.Form
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 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.gofo***@gmail.com> wrote in message Show quote 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 > 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: Show quote > 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.gofo***@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 > > you cant split the string in mypage1.asp?
<eric.gofo***@gmail.com> wrote in message Show quote 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: >> 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.gofo***@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 >> > > lol listen to bob..........hes a pro, not me, lol
Show quote "James Jones" <jamisonburrou***@insightbb.com> wrote in message news:OPDD7wglGHA.3304@TK2MSFTNGP03.phx.gbl... > you cant split the string in mypage1.asp? > > > > > <eric.gofo***@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: >>> 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.gofo***@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 >>> > >> > > wrote on 22 jun 2006 in microsoft.public.inetserver.asp.general:
> James Jones wrote: [please do not toppost on usenet]>> 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. > In mypage2.asp I'd like to get the value of ID2, but ID2 isn't in my try:> 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"). 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) eric.gofo***@gmail.com wrote:
Show quote > Hello, If you think you are providing some sort of security by doing this, then> > 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> think again. Show quote > dim ar,arid2,id2> </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") > 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. 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: Show quote > eric.gofo***@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. |
|||||||||||||||||||||||