Separating out concatenated values in Request.Form

Discussion in 'ASP General' started by eric.goforth@gmail.com, Jun 22, 2006.

  1. Guest

    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&amp;ecd=1&amp;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&amp;ID2=2235"></td>

    </form>

    Now debugging in Interdev inside the mypage2.asp

    I see:

    Request.Form("UrlParms") = "ID1=97702&amp;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
     
    , Jun 22, 2006
    #1
    1. Advertising

  2. James Jones Guest

    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






    <> wrote in message
    news:...
    > 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&amp;ecd=1&amp;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&amp;ID2=2235"></td>
    >
    > </form>
    >
    > Now debugging in Interdev inside the mypage2.asp
    >
    > I see:
    >
    > Request.Form("UrlParms") = "ID1=97702&amp;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, Jun 22, 2006
    #2
    1. Advertising

  3. Guest

    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&amp;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
    >
    >
    >
    >
    >
    >
    > <> wrote in message
    > news:...
    > > 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&amp;ecd=1&amp;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&amp;ID2=2235"></td>
    > >
    > > </form>
    > >
    > > Now debugging in Interdev inside the mypage2.asp
    > >
    > > I see:
    > >
    > > Request.Form("UrlParms") = "ID1=97702&amp;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
    > >
     
    , Jun 22, 2006
    #3
  4. 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&amp;ecd=1&amp;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&amp;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&amp;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"),"&amp;")
    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.
     
    Bob Barrows [MVP], Jun 22, 2006
    #4
  5. James Jones Guest

    you cant split the string in mypage1.asp?




    <> wrote in message
    news:...
    > 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&amp;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
    >>
    >>
    >>
    >>
    >>
    >>
    >> <> wrote in message
    >> news:...
    >> > 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&amp;ecd=1&amp;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&amp;ID2=2235"></td>
    >> >
    >> > </form>
    >> >
    >> > Now debugging in Interdev inside the mypage2.asp
    >> >
    >> > I see:
    >> >
    >> > Request.Form("UrlParms") = "ID1=97702&amp;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, Jun 22, 2006
    #5
  6. James Jones Guest

    lol listen to bob..........hes a pro, not me, lol






    "James Jones" <> wrote in message
    news:...
    > you cant split the string in mypage1.asp?
    >
    >
    >
    >
    > <> wrote in message
    > news:...
    >> 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&amp;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
    >>>
    >>>
    >>>
    >>>
    >>>
    >>>
    >>> <> wrote in message
    >>> news:...
    >>> > 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&amp;ecd=1&amp;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&amp;ID2=2235"></td>
    >>> >
    >>> > </form>
    >>> >
    >>> > Now debugging in Interdev inside the mypage2.asp
    >>> >
    >>> > I see:
    >>> >
    >>> > Request.Form("UrlParms") = "ID1=97702&amp;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, Jun 22, 2006
    #6
  7. Guest

    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:
    > 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&amp;ecd=1&amp;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&amp;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&amp;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"),"&amp;")
    > 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.
     
    , Jun 22, 2006
    #7
  8. Evertjan. Guest

    wrote on 22 jun 2006 in microsoft.public.inetserver.asp.general:
    > 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.


    [please do not toppost on usenet]

    > 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&amp;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)
     
    Evertjan., Jun 22, 2006
    #8
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Steve
    Replies:
    0
    Views:
    5,340
    Steve
    Jul 1, 2003
  2. dh
    Replies:
    0
    Views:
    334
  3. Chumley the Walrus

    Separating form elements on aspx page

    Chumley the Walrus, Aug 3, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    385
    Eliyahu Goldin
    Aug 3, 2004
  4. Shabam

    Form variable concatenated

    Shabam, Sep 16, 2005, in forum: HTML
    Replies:
    2
    Views:
    407
    Mark Parnell
    Sep 16, 2005
  5. David
    Replies:
    1
    Views:
    147
    Daniel Crichton
    Jan 29, 2008
Loading...

Share This Page