Method POST not working

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?Utf-8?B?QkxVRVNUQVI=?=

    Method POST not working

    Here is the link of the website


    I have been told to change only the form action part of this site.which is
    to "response.a sp"
    Here the method POST is not working,and I dont know how to solve this
    problem

    I have tried making my own sample. asp page with 4 textareas as in
    YourThoughts.as p,and also I have kept the textarea name and ID same as that.

    My sample asp is working perfectly fine,in my page method POST is working. I
    need to insert content of textarea in database,

    But in YourThoughts.as p nothing is being inserted in database .after
    clicking the submit button, the page just redirects to response.asp.

    Please please help me, how to solve this problem.


    Thank You

  • =?Utf-8?B?QkxVRVNUQVI=?=

    #2
    RE: Method POST not working

    I forgot to add,is it because YourThoughts.as p have multiple forms,but as far
    as I know ASP can have multiple form,also I tried deleting the form "which I
    am not suppose to as they dont want any changes in their website" but still
    the problem persist.

    Please do reply!!!!!!!!

    Thank You

    "BLUESTAR" wrote:
    Here is the link of the website

    >
    I have been told to change only the form action part of this site.which is
    to "response.a sp"
    Here the method POST is not working,and I dont know how to solve this
    problem
    >
    I have tried making my own sample. asp page with 4 textareas as in
    YourThoughts.as p,and also I have kept the textarea name and ID same as that.
    >
    My sample asp is working perfectly fine,in my page method POST is working. I
    need to insert content of textarea in database,
    >
    But in YourThoughts.as p nothing is being inserted in database .after
    clicking the submit button, the page just redirects to response.asp.
    >
    Please please help me, how to solve this problem.
    >
    >
    Thank You
    >

    Comment

    • Mike Brind [MVP]

      #3
      Re: Method POST not working


      "BLUESTAR" <BLUESTAR@discu ssions.microsof t.comwrote in message
      news:4A8DD21F-50AC-4768-8AAB-B3FD03BA695D@mi crosoft.com...
      Here is the link of the website

      >
      I have been told to change only the form action part of this site.which is
      to "response.a sp"
      Here the method POST is not working,and I dont know how to solve this
      problem
      >
      I have tried making my own sample. asp page with 4 textareas as in
      YourThoughts.as p,and also I have kept the textarea name and ID same as
      that.
      >
      My sample asp is working perfectly fine,in my page method POST is working.
      I
      need to insert content of textarea in database,
      >
      But in YourThoughts.as p nothing is being inserted in database .after
      clicking the submit button, the page just redirects to response.asp.
      >
      Please please help me, how to solve this problem.
      >
      >
      Thank You
      Since this group deals with asp (which runs on the server and is not
      accessible via the browser) perhaps you should post the code that you are
      trying to "get to work" and explain the symptoms that lead you to believe it
      "is not working".

      --
      Mike Brind
      MVP - ASP/ASP.NET


      Comment

      • =?Utf-8?B?T2xkIFBlZGFudA==?=

        #4
        RE: Method POST not working

        So where is the code for "response.asp"? ????


        Comment

        • =?Utf-8?B?T2xkIFBlZGFudA==?=

          #5
          RE: Method POST not working

          "BLUESTAR" wrote:
          I forgot to add,is it because YourThoughts.as p have multiple forms,but as far
          as I know ASP can have multiple form
          Nothing to do with ASP. HTML allows as many <FORMtags on a page as you
          want. Only restriction is that they CAN NOT be nested (you can't have a
          <FORMtag *inside* another <FORM>....</FORMrange).

          And *ONLY* the <FORMthat is actually submitted by the user will be posted
          to the ACTION= specified in that one <FORM>. All other forms are ignored.

          This is true whether you are using ASP or PHP or JSP or even just using a
          <FORMto go to another HTML page.

          As Mike said, no code, no help. We can't read your mind.


          Comment

          • =?Utf-8?B?QkxVRVNUQVI=?=

            #6
            RE: Method POST not working


            Okay somehow I have solved the error,but now i am stuck in new error.

            this is the response.asp code
            <%
            Set db=Server.Creat eObject ("ADODB.Connect ion")
            db.Open "DSN=mysurv ey;"
            strDate=Date()
            for i=1 to 4
            res=Request.For m("Your Thoughts Q"&i)
            sSQL = "INSERT INTO survey (ID,Response,Da te) "
            sSQL=sSQL & " VALUES ( '"
            sSQL=sSQL & i & "','"
            sSQL=sSQL & res & "','"
            sSQL=sSQL & strDate & "')"
            db.Execute sSQL
            Next
            db.Close
            Response.Write ("Your data has been successfully send.Thanks for your
            response!!!")

            %>
            this the link of the website from where data will be stored in database.


            The error I am getting

            HTTP 500.100 - Internal Server Error - ASP error
            Internet Information Services

            Technical Information (for support personnel)

            * Error Type:
            Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
            [Microsoft][ODBC Microsoft Access Driver] Syntax error in INSERT INTO
            statement.
            /testasp/SurveyResponse. asp, line 13

            * Browser Type:
            Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.16)
            Gecko/20080702 Firefox/2.0.0.16

            * Page:
            POST 93 bytes to /testasp/SurveyResponse. asp

            * POST Data:

            Your+Thoughts+Q 1=gf&Your+Thoug hts+Q2=dd&Your+ Thoughts+Q3=cc& Your+Thoughts+Q 4=bb&Submit=Sub mit

            * Time:
            Wednesday, July 16, 2008,

            I have even tried the following,but problem persist.

            In IE, turn off the "Friendly HTTP error messages" by choosing tools -
            internet options - advanced. The full error messages as well as the line
            number of the error will then be displayed.


            Thanks Again for your support

            "Old Pedant" wrote:
            So where is the code for "response.asp"? ????
            >
            >

            Comment

            • =?Utf-8?B?QkxVRVNUQVI=?=

              #7
              RE: Method POST not working


              one more thing to add,the insert statement is working perfectly fine and
              even response.asp is working correctly when i run it in sql server 2005.but
              when i used Access 2007 the problem occurs.and i will have use Access
              only..no escape.

              i have configured my connection string same as before,but i don no where am
              i wrong
              "Old Pedant" wrote:
              So where is the code for "response.asp"? ????
              >
              >

              Comment

              • Bob Barrows [MVP]

                #8
                Re: Method POST not working

                BLUESTAR wrote:
                Okay somehow I have solved the error,but now i am stuck in new error.
                >
                this is the response.asp code
                <%
                Set db=Server.Creat eObject ("ADODB.Connect ion")
                db.Open "DSN=mysurv ey;"
                strDate=Date()
                for i=1 to 4
                res=Request.For m("Your Thoughts Q"&i)
                sSQL = "INSERT INTO survey (ID,Response,Da te) "
                sSQL=sSQL & " VALUES ( '"
                sSQL=sSQL & i & "','"
                sSQL=sSQL & res & "','"
                sSQL=sSQL & strDate & "')"
                db.Execute sSQL
                Next
                db.Close
                Response.Write ("Your data has been successfully send.Thanks for your
                response!!!")
                >
                %>
                <snip>
                * Error Type:
                Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
                [Microsoft][ODBC Microsoft Access Driver] Syntax error in
                INSERT INTO statement.
                /testasp/SurveyResponse. asp, line 13
                >
                You cannot debug a sql statement without knowing what it is. Insert the
                following before the Execute statement:

                '***********com ment out when finished debugging****** *
                Response.Write sSQL & "<BR>"
                Response.End
                '***********com ment out when finished debugging****** *

                Run the page and look at the resulting sql statement. The error should
                stick out like a sore thumb. If not post it here.

                Further points to consider:
                Your use of dynamic sql is leaving you vulnerable to hackers using sql
                injection:



                See here for a better, more secure way to execute your queries by using
                parameter markers (tokens):


                Personally, I prefer using stored procedures, or saved parameter queries
                as they are known in Access:

                Access:




                SQL Server:


                >
                I have even tried the following,but problem persist.
                >
                In IE, turn off the "Friendly HTTP error messages" by choosing tools -
                internet options - advanced. The full error messages as well as the
                line number of the error will then be displayed.
                >
                Friendly Errors was already disabled
                --
                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

                • =?Utf-8?B?QkxVRVNUQVI=?=

                  #9
                  RE: Method POST not working


                  thanks for reply

                  but after adding Response.Write sSQL & "<BR>"
                  Response.End

                  I am getting this
                  INSERT INTO survey (ID,Response,to daydate) VALUES ( '1','s','7/16/2008')
                  but i have used for loop which will insert 4 datas,but here i am showed only
                  one.

                  so what do you think ,my INSERT query is correct?????
                  but nothing is being inserted in database.
                  my problem is i am not use to Microsoft Access,

                  Please do reply

                  Thanks
                  "BLUESTAR" wrote:
                  >
                  one more thing to add,the insert statement is working perfectly fine and
                  even response.asp is working correctly when i run it in sql server 2005.but
                  when i used Access 2007 the problem occurs.and i will have use Access
                  only..no escape.
                  >
                  i have configured my connection string same as before,but i don no where am
                  i wrong
                  "Old Pedant" wrote:
                  >
                  So where is the code for "response.asp"? ????

                  Comment

                  • =?Utf-8?B?QkxVRVNUQVI=?=

                    #10
                    RE: Method POST not working


                    Now I am getting this error
                    rror Type:
                    Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
                    [Microsoft][ODBC Microsoft Access Driver] Operation must use an updateable
                    query.
                    /testasp/SurveyResponse. asp, line 16

                    line 16 is db.Execute sSQL



                    "BLUESTAR" wrote:
                    >
                    thanks for reply
                    >
                    but after adding Response.Write sSQL & "<BR>"
                    Response.End
                    >
                    I am getting this
                    INSERT INTO survey (ID,Response,to daydate) VALUES ( '1','s','7/16/2008')
                    but i have used for loop which will insert 4 datas,but here i am showed only
                    one.
                    >
                    so what do you think ,my INSERT query is correct?????
                    but nothing is being inserted in database.
                    my problem is i am not use to Microsoft Access,
                    >
                    Please do reply
                    >
                    Thanks
                    "BLUESTAR" wrote:
                    >

                    one more thing to add,the insert statement is working perfectly fine and
                    even response.asp is working correctly when i run it in sql server 2005.but
                    when i used Access 2007 the problem occurs.and i will have use Access
                    only..no escape.

                    i have configured my connection string same as before,but i don no where am
                    i wrong
                    "Old Pedant" wrote:
                    So where is the code for "response.asp"? ????
                    >
                    >

                    Comment

                    • Bob Barrows [MVP]

                      #11
                      Re: Method POST not working

                      No, assuming todaydate is a date/time field and not a Text field, it is
                      not correct. In Access, date literals need to be delimited by #, not '.
                      You should read my links and parameterize this statement. Not only will
                      that make you immune to sql injection, but it will also allow you to
                      forget about delimiters.

                      BLUESTAR wrote:
                      thanks for reply
                      >
                      but after adding Response.Write sSQL & "<BR>"
                      Response.End
                      >
                      I am getting this
                      INSERT INTO survey (ID,Response,to daydate) VALUES (
                      '1','s','7/16/2008') but i have used for loop which will insert 4
                      datas,but here i am showed only one.
                      >
                      so what do you think ,my INSERT query is correct?????
                      but nothing is being inserted in database.
                      my problem is i am not use to Microsoft Access,
                      >
                      Please do reply
                      >
                      Thanks
                      "BLUESTAR" wrote:
                      >
                      >>
                      >one more thing to add,the insert statement is working perfectly fine
                      >and even response.asp is working correctly when i run it in sql
                      >server 2005.but when i used Access 2007 the problem occurs.and i
                      >will have use Access only..no escape.
                      >>
                      >i have configured my connection string same as before,but i don no
                      >where am i wrong
                      >"Old Pedant" wrote:
                      >>
                      >>So where is the code for "response.asp"? ????
                      --
                      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

                      • =?Utf-8?B?QkxVRVNUQVI=?=

                        #12
                        RE: Method POST not working


                        Problem solved!!!
                        Thanks
                        "BLUESTAR" wrote:
                        >
                        Now I am getting this error
                        rror Type:
                        Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
                        [Microsoft][ODBC Microsoft Access Driver] Operation must use an updateable
                        query.
                        /testasp/SurveyResponse. asp, line 16
                        >
                        line 16 is db.Execute sSQL
                        >
                        >
                        >
                        "BLUESTAR" wrote:
                        >

                        thanks for reply

                        but after adding Response.Write sSQL & "<BR>"
                        Response.End

                        I am getting this
                        INSERT INTO survey (ID,Response,to daydate) VALUES ( '1','s','7/16/2008')
                        but i have used for loop which will insert 4 datas,but here i am showed only
                        one.

                        so what do you think ,my INSERT query is correct?????
                        but nothing is being inserted in database.
                        my problem is i am not use to Microsoft Access,

                        Please do reply

                        Thanks
                        "BLUESTAR" wrote:
                        >
                        one more thing to add,the insert statement is working perfectly fine and
                        even response.asp is working correctly when i run it in sql server 2005.but
                        when i used Access 2007 the problem occurs.and i will have use Access
                        only..no escape.
                        >
                        i have configured my connection string same as before,but i don no where am
                        i wrong
                        "Old Pedant" wrote:
                        >
                        So where is the code for "response.asp"? ????

                        Comment

                        Working...