querystrings

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Amy

    #1

    querystrings

    I am having a strange problem. I pass data as a
    querystring from an aspx page to an asp page to generate
    an email. THe data is then used to go back to the
    original page and allow access based on previous
    permissions. I can access half of my querystrings on the
    asp page and display them however two that are vital are
    not displaying in the asp page and are not being passed
    back in the href as a querystring.

    Please any help is appreciated.

    Here is the code for both pages - a little sloppy but I
    tried so many things.

    Private Sub btnemail_Click( ByVal sender As
    System.Object, ByVal e As System.EventArg s) Handles
    btnemail.Click
    Dim inttrx As Integer
    inttrx = CType(lblmaxtrx id.Text, Integer)
    SqlUpdateComman d5.Parameters(" @ec").Value =
    txtEC.Text
    SqlUpdateComman d5.Parameters(" @tid").Value =
    inttrx
    SqlConnection1. Open()
    SqlUpdateComman d5.ExecuteNonQu ery()
    SqlConnection1. Close()

    If txtEC.Text > 2500 Then
    Response.Redire ct
    ("https://virtualog/GPC/bvdform.asp?trx id=" &
    (lblmaxtrxid.Te xt) & "&sendto=" & txtemail.Text & "&pch"
    & CType(lblpch.Te xt, Integer) & "&uid=" & lbluserid.Text
    & "")
    Else

    Userid = Request.QuerySt ring("uid")
    Response.Redire ct
    ("https://Virtualog/GPC/emailrequest.as p?trxid=" &
    (lblmaxtrxid.Te xt) & "&sendto=" & txtemail.Text & "&pch"
    & CType(lblpch.Te xt, Integer) & "&uid=" & lbluserid.Text
    & "")
    End If
    End Sub


    THe ASP PAGE::

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01
    Transitional//EN">
    <html>
    <head>
    <title>GPC Request Notification</title>
    <meta http-equiv="Content-Type" content="text/html;
    charset=iso-8859-1">
    </head>

    <body>
    <%

    trxid = request.QuerySt ring("trxid")
    sendname = request.QuerySt ring("sendto")
    sendto = sendname + "@charleston.af .mil"
    'response.Write (sendto)
    Userid = Request.QuerySt ring("uid")
    'userid = 110
    'response.Write (userid)
    permitpch = request.QuerySt ring("pch")
    'permitpch = 13
    'response.Write (permitpch)
    username = request.QuerySt ring("uid")
    response.Write( request.QuerySt ring("uid"))

    response.Write( "userid= "& uid&"<br>")


    Set mail = Server.createob ject("Persits.M ailSender")
    mail.host = "131.9.25.1 44"
    Mail.port=25
    Mail.From = "Virtualog@char leston.af.mil"
    Mail.FromName = "Moneta GPC Request Submission"
    Mail.AddAddress sendto
    'Mail.AddAddres s "amy.powell@cha rleston.af.mil"
    Mail.Subject = " Moneta GPC Request Submission"
    MyBody= " A new request ( Transaction # "&trxid&" ) has
    been submitted for approval from "&username& "
    id= "&uid&". Please go to Moneta to review the GPC
    Request."

    Mail.Body = MyBody
    Mail.IsHTML = True
    On error resume Next
    Mail.Send
    IF Err <> 0 Then
    Response.write "An error occurred:" & Err.description
    End if
    response.Write( "Your email notifiction has been sent to
    &nbsp;"& sendto &" &nbsp; requesting approval for
    transaction # "& trxid&".")%>

    <br>
    <br>
    <a href="Https://virtualog/GPCindex/nindex.asp?uid= <%
    =request.QueryS tring("uid")%>& pch=<%=request. QueryString
    ("pch")%>">Retu rn to Moneta</a><br><br><br>
    <a href="https://virtualog/gpc/gpctrx.aspx?uid =<%
    =request.QueryS tring("uid")%>& pch=<%=request. QueryString
    ("pch")%>">Retu rn to GPC Transactions</a><br><br><br>
    <a href="https://infofusion/og/logout.cfm">End Moneta
    session (Log Out)</a><br><br><br>
    </body>
    </html>



    Please help this is driving me crazy.
  • Ryan Cooper

    #2
    Re: querystrings

    Hi Amy;
    Based on your code, there is no = character after your "pch" querystrings
    variable. This would cause the pch variable and all subsequent variables in
    the string to not be passed. I have corrected the code in this block below.
    HTH, Ryan

    <CODE>
    If txtEC.Text > 2500 Then[color=blue]
    > Response.Redire ct
    > ("https://virtualog/GPC/bvdform.asp?trx id=" &
    > (lblmaxtrxid.Te xt) & "&sendto=" & txtemail.Text & "&pch="
    > & CType(lblpch.Te xt, Integer) & "&uid=" & lbluserid.Text
    > & "")
    > Else
    >
    > Userid = Request.QuerySt ring("uid")
    > Response.Redire ct
    > ("https://Virtualog/GPC/emailrequest.as p?trxid=" &
    > (lblmaxtrxid.Te xt) & "&sendto=" & txtemail.Text & "&pch="
    > & CType(lblpch.Te xt, Integer) & "&uid=" & lbluserid.Text
    > & "")
    > End If[/color]

    </CODE>


    "Amy" <amy.powell@cha rleston.af.mil> wrote in message
    news:012501c3a4 82$de68f4f0$a10 1280a@phx.gbl.. .[color=blue]
    > I am having a strange problem. I pass data as a
    > querystring from an aspx page to an asp page to generate
    > an email. THe data is then used to go back to the
    > original page and allow access based on previous
    > permissions. I can access half of my querystrings on the
    > asp page and display them however two that are vital are
    > not displaying in the asp page and are not being passed
    > back in the href as a querystring.
    >
    > Please any help is appreciated.
    >
    > Here is the code for both pages - a little sloppy but I
    > tried so many things.
    >
    > Private Sub btnemail_Click( ByVal sender As
    > System.Object, ByVal e As System.EventArg s) Handles
    > btnemail.Click
    > Dim inttrx As Integer
    > inttrx = CType(lblmaxtrx id.Text, Integer)
    > SqlUpdateComman d5.Parameters(" @ec").Value =
    > txtEC.Text
    > SqlUpdateComman d5.Parameters(" @tid").Value =
    > inttrx
    > SqlConnection1. Open()
    > SqlUpdateComman d5.ExecuteNonQu ery()
    > SqlConnection1. Close()
    >
    > If txtEC.Text > 2500 Then
    > Response.Redire ct
    > ("https://virtualog/GPC/bvdform.asp?trx id=" &
    > (lblmaxtrxid.Te xt) & "&sendto=" & txtemail.Text & "&pch"
    > & CType(lblpch.Te xt, Integer) & "&uid=" & lbluserid.Text
    > & "")
    > Else
    >
    > Userid = Request.QuerySt ring("uid")
    > Response.Redire ct
    > ("https://Virtualog/GPC/emailrequest.as p?trxid=" &
    > (lblmaxtrxid.Te xt) & "&sendto=" & txtemail.Text & "&pch"
    > & CType(lblpch.Te xt, Integer) & "&uid=" & lbluserid.Text
    > & "")
    > End If
    > End Sub
    >
    >
    > THe ASP PAGE::
    >
    > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01
    > Transitional//EN">
    > <html>
    > <head>
    > <title>GPC Request Notification</title>
    > <meta http-equiv="Content-Type" content="text/html;
    > charset=iso-8859-1">
    > </head>
    >
    > <body>
    > <%
    >
    > trxid = request.QuerySt ring("trxid")
    > sendname = request.QuerySt ring("sendto")
    > sendto = sendname + "@charleston.af .mil"
    > 'response.Write (sendto)
    > Userid = Request.QuerySt ring("uid")
    > 'userid = 110
    > 'response.Write (userid)
    > permitpch = request.QuerySt ring("pch")
    > 'permitpch = 13
    > 'response.Write (permitpch)
    > username = request.QuerySt ring("uid")
    > response.Write( request.QuerySt ring("uid"))
    >
    > response.Write( "userid= "& uid&"<br>")
    >
    >
    > Set mail = Server.createob ject("Persits.M ailSender")
    > mail.host = "131.9.25.1 44"
    > Mail.port=25
    > Mail.From = "Virtualog@char leston.af.mil"
    > Mail.FromName = "Moneta GPC Request Submission"
    > Mail.AddAddress sendto
    > 'Mail.AddAddres s "amy.powell@cha rleston.af.mil"
    > Mail.Subject = " Moneta GPC Request Submission"
    > MyBody= " A new request ( Transaction # "&trxid&" ) has
    > been submitted for approval from "&username& "
    > id= "&uid&". Please go to Moneta to review the GPC
    > Request."
    >
    > Mail.Body = MyBody
    > Mail.IsHTML = True
    > On error resume Next
    > Mail.Send
    > IF Err <> 0 Then
    > Response.write "An error occurred:" & Err.description
    > End if
    > response.Write( "Your email notifiction has been sent to
    > &nbsp;"& sendto &" &nbsp; requesting approval for
    > transaction # "& trxid&".")%>
    >
    > <br>
    > <br>
    > <a href="Https://virtualog/GPCindex/nindex.asp?uid= <%
    > =request.QueryS tring("uid")%>& pch=<%=request. QueryString
    > ("pch")%>">Retu rn to Moneta</a><br><br><br>
    > <a href="https://virtualog/gpc/gpctrx.aspx?uid =<%
    > =request.QueryS tring("uid")%>& pch=<%=request. QueryString
    > ("pch")%>">Retu rn to GPC Transactions</a><br><br><br>
    > <a href="https://infofusion/og/logout.cfm">End Moneta
    > session (Log Out)</a><br><br><br>
    > </body>
    > </html>
    >
    >
    >
    > Please help this is driving me crazy.[/color]


    Comment

    Working...