Separating out concatenated values in Request.Form

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • eric.goforth@gmail.com

    Separating out concatenated values in Request.Form

    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?sub type=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=9770 2&amp;ID2=2235" ></td>

    </form>

    Now debugging in Interdev inside the mypage2.asp

    I see:

    Request.Form("U rlParms") = "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.QuerySt ring("ID2")

    Thanks,
    Eric

  • James Jones

    #2
    Re: Separating out concatenated values in Request.Form

    what you mean you want to seperate them? if you want them seprate, then
    combined try this........... .


    ID1 = Request.QuerySt ring("ID1")
    ID2 = Request.QuerySt ring("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@g mail.com> wrote in message
    news:1150986874 .365119.45340@g 10g2000cwb.goog legroups.com...[color=blue]
    > 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?sub type=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=9770 2&amp;ID2=2235" ></td>
    >
    > </form>
    >
    > Now debugging in Interdev inside the mypage2.asp
    >
    > I see:
    >
    > Request.Form("U rlParms") = "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.QuerySt ring("ID2")
    >
    > Thanks,
    > Eric
    >[/color]


    Comment

    • eric.goforth@gmail.com

      #3
      Re: Separating out concatenated values in Request.Form

      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("U rlParms") = "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.QuerySt ring("ID2").

      Thanks,
      Eric

      James Jones wrote:[color=blue]
      > what you mean you want to seperate them? if you want them seprate, then
      > combined try this........... .
      >
      >
      > ID1 = Request.QuerySt ring("ID1")
      > ID2 = Request.QuerySt ring("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@g mail.com> wrote in message
      > news:1150986874 .365119.45340@g 10g2000cwb.goog legroups.com...[color=green]
      > > 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?sub type=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=9770 2&amp;ID2=2235" ></td>
      > >
      > > </form>
      > >
      > > Now debugging in Interdev inside the mypage2.asp
      > >
      > > I see:
      > >
      > > Request.Form("U rlParms") = "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.QuerySt ring("ID2")
      > >
      > > Thanks,
      > > Eric
      > >[/color][/color]

      Comment

      • Bob Barrows [MVP]

        #4
        Re: Separating out concatenated values in Request.Form

        eric.goforth@gm ail.com wrote:[color=blue]
        > 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?sub type=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=9770 2&amp;ID2=2235" ></td>[/color]

        If you think you are providing some sort of security by doing this, then
        think again.
        [color=blue]
        >
        > </form>
        >
        > Now debugging in Interdev inside the mypage2.asp
        >
        > I see:
        >
        > Request.Form("U rlParms") = "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.QuerySt ring("ID2")
        >[/color]

        dim ar,arid2,id2
        ar=split(Reques t.Form("UrlParm s"),"&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.


        Comment

        • James Jones

          #5
          Re: Separating out concatenated values in Request.Form

          you cant split the string in mypage1.asp?




          <eric.goforth@g mail.com> wrote in message
          news:1150987921 .910967.171030@ u72g2000cwu.goo glegroups.com.. .[color=blue]
          > 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("U rlParms") = "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.QuerySt ring("ID2").
          >
          > Thanks,
          > Eric
          >
          > James Jones wrote:[color=green]
          >> what you mean you want to seperate them? if you want them seprate, then
          >> combined try this........... .
          >>
          >>
          >> ID1 = Request.QuerySt ring("ID1")
          >> ID2 = Request.QuerySt ring("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@g mail.com> wrote in message
          >> news:1150986874 .365119.45340@g 10g2000cwb.goog legroups.com...[color=darkred]
          >> > 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?sub type=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=9770 2&amp;ID2=2235" ></td>
          >> >
          >> > </form>
          >> >
          >> > Now debugging in Interdev inside the mypage2.asp
          >> >
          >> > I see:
          >> >
          >> > Request.Form("U rlParms") = "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.QuerySt ring("ID2")
          >> >
          >> > Thanks,
          >> > Eric
          >> >[/color][/color]
          >[/color]


          Comment

          • James Jones

            #6
            Re: Separating out concatenated values in Request.Form

            lol listen to bob..........he s a pro, not me, lol






            "James Jones" <jamisonburrous 08@insightbb.co m> wrote in message
            news:OPDD7wglGH A.3304@TK2MSFTN GP03.phx.gbl...[color=blue]
            > you cant split the string in mypage1.asp?
            >
            >
            >
            >
            > <eric.goforth@g mail.com> wrote in message
            > news:1150987921 .910967.171030@ u72g2000cwu.goo glegroups.com.. .[color=green]
            >> 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("U rlParms") = "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.QuerySt ring("ID2").
            >>
            >> Thanks,
            >> Eric
            >>
            >> James Jones wrote:[color=darkred]
            >>> what you mean you want to seperate them? if you want them seprate, then
            >>> combined try this........... .
            >>>
            >>>
            >>> ID1 = Request.QuerySt ring("ID1")
            >>> ID2 = Request.QuerySt ring("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@g mail.com> wrote in message
            >>> news:1150986874 .365119.45340@g 10g2000cwb.goog legroups.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?sub type=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=9770 2&amp;ID2=2235" ></td>
            >>> >
            >>> > </form>
            >>> >
            >>> > Now debugging in Interdev inside the mypage2.asp
            >>> >
            >>> > I see:
            >>> >
            >>> > Request.Form("U rlParms") = "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.QuerySt ring("ID2")
            >>> >
            >>> > Thanks,
            >>> > Eric
            >>> >[/color]
            >>[/color]
            >
            >[/color]


            Comment

            • eric.goforth@gmail.com

              #7
              Re: Separating out concatenated values in Request.Form

              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:[color=blue]
              > eric.goforth@gm ail.com wrote:[color=green]
              > > 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?sub type=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=9770 2&amp;ID2=2235" ></td>[/color]
              >
              > If you think you are providing some sort of security by doing this, then
              > think again.
              >[color=green]
              > >
              > > </form>
              > >
              > > Now debugging in Interdev inside the mypage2.asp
              > >
              > > I see:
              > >
              > > Request.Form("U rlParms") = "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.QuerySt ring("ID2")
              > >[/color]
              >
              > dim ar,arid2,id2
              > ar=split(Reques t.Form("UrlParm s"),"&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.[/color]

              Comment

              • Evertjan.

                #8
                Re: Separating out concatenated values in Request.Form

                wrote on 22 jun 2006 in microsoft.publi c.inetserver.as p.general:[color=blue]
                > James Jones wrote:[color=green]
                >> what you mean you want to seperate them? if you want them seprate,
                >> then combined try this........... .
                >>
                >>
                >> ID1 = Request.QuerySt ring("ID1")
                >> ID2 = Request.QuerySt ring("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.[/color][/color]

                [please do not toppost on usenet]
                [color=blue]
                > 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("U rlParms") = "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.QuerySt ring("ID2").[/color]

                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)

                Comment

                Working...