Multiple submit buttons in one page - PHP and MYSQL

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • fliss
    New Member
    • Nov 2006
    • 1

    #1

    Multiple submit buttons in one page - PHP and MYSQL

    Hello

    I have four submit buttons on my page - each carrying a value which refreshes the page selects from my db and displays the results in the drop down.

    The prob is i would like another submit button which will run the queries and display the drop down.

    (i need to have it that way because i enter into text field, then click one of four buttons, which displays radio buttons depending on the button clicked) then click on the radio button and THEN click submit, which will use all of the varibles from the text box, button selected and the radio to run a query in the db.

    It currently works without the extra submit button and the radio button defaulted to an option.

    The submit button refreshes the page and everything is blank

    Any ideas, suggestions would be greatly appreciated - I am not a programmer - so please asume i know nothing.

    Thanks in advance.

    Fliss
  • cassbiz
    New Member
    • Oct 2006
    • 202

    #2
    I would suggest going with an AJAX form so that it will auto-update with what you need.

    Comment

    • ronverdonk
      Recognized Expert Specialist
      • Jul 2006
      • 4259

      #3
      When you are not a programmer, it will be hard to explain.
      When processing the POSTed values (I assume it is posted) in a different script then the one that asks for the input, you must save them somewhere, an easy place would be the $_SESSION array. Then, when the page is refreshed, you can take the values from the $_SESSION array and display the values in the value fields or the 'checked=checke d' value in the radio button entries.
      That is basically what you should do to re-display after processing the POSTed values in another script.

      When you process the values after a submit button in the same script as the one that submits, you simply display the results (see above) from the $_POST array into the form fields.

      I cannot describe this process any simpler then this.

      Ronald :cool:

      Comment

      Working...