My form variables are not being passed to server script!

Discussion in 'C#' started by Sleeping Troll, Jun 26, 2008.

  1. #1
    This script handles a form submission with a text area and a text field, I can see the vars in my header in proper pairs, however the Response.Writes show up as blank. Can someone see what stupid little thing I am missing here?

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <%
    [COLOR="Red"]Memo=Request.QueryString("Memo")
    Email=Request.QueryString("Email")
    Response.Write(Memo)
    Response.Write(Email)[/COLOR]
    Set conn=Server.CreateObject("ADODB.Connection")
    conn.Provider="Microsoft.Jet.OLEDB.4.0"
    conn.Open Server.MapPath("/Data/WebData.mdb")
    SQL="Insert Into Memos Values (Now(),'"&Memo&"','"&Email&"')"
    Response.Write(SQL)
    'conn.Execute SQL 
    conn.close
    Set conn=nothing
    %>
    <html>
    <head>
    </head>
    <body>
    <style type="text/css">
    <!--
    body {
    	background-image: url(/images/Santa%20Fe%20Stucco.bmp);
    }
    -->
    </style>
    <p>&nbsp;</p>
    <h2 align="center">Your note has been sent, Thank you! </h2>
    </body>
    Code (markup):
     
    Sleeping Troll, Jun 26, 2008 IP
  2. wowla_123

    wowla_123 Peon

    Messages:
    147
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Can you please show the code of the form too?
     
    wowla_123, Jun 27, 2008 IP
  3. shaileshk

    shaileshk Well-Known Member

    Messages:
    455
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    108
    #3
    Please check Memo text box is inside the <form..></form>

    and also check are you using submit buttin on you request page.
     
    shaileshk, Jun 27, 2008 IP
  4. sydmeeran

    sydmeeran Active Member

    Messages:
    138
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    51
    #4
    post the <form> code...

    Are you getting any error,...
     
    sydmeeran, Jun 27, 2008 IP
  5. dylanj

    dylanj Peon

    Messages:
    173
    Likes Received:
    3
    Best Answers:
    1
    Trophy Points:
    0
    #5
    If you're using <form method="post"> then you should use Request.Form rather than Request.Querystring:
    
    Memo=Request.Form("Memo")
    Email=Request.Form("Email")
    Response.Write(Memo)
    Response.Write(Email)
    
    Code (markup):
    If you're using <form method="get"> or you haven't set a method at all, then try typing in the url of your webpage like this, and see if you get anything to show up:
    
    http://www.mydomain.com/myfolder/mypage.asp?Memo=Hello+World
    
    Code (markup):
    Also, remember that form names ARE CASE SENSITIVE. So Request.Form("Memo") is completely different to Request.Form("memo").

    Hope this solves your problem :)
     
    dylanj, Jun 29, 2008 IP
    ludwig likes this.