Goose87 Posted July 27, 2007 Share Posted July 27, 2007 Ok, to put this all into context i have a table created through echo's which display data from the database. The database has multiple items in the thing, so i have lots of rows. Each row has a submit button on it with a different hidden ID, which is $row[0], which is the ID of the items that are being displayed. Displaying all the data and having the submit buttons isnt the problem. The problem is clicking the button. I'm not sure how to manage the data at the end. At the moment I have: if(isset($_POST['buy'])) { $w = $_POST['equipment']; and then i want this to do an "insert into" on a different table with the id of "equipment" and the id of the user (which is stored in the session). The database syntax works coz i tested it, but what to type after the: if(isset($_POST['buy'])) { just loses me. Any help would be greatly appreciated! thanks. Goose. Link to comment https://forums.phpfreaks.com/topic/61963-multiple-submit-buttons-on-one-page/ Share on other sites More sharing options...
btherl Posted July 27, 2007 Share Posted July 27, 2007 Please post your code (including the code that generates the submit button) Link to comment https://forums.phpfreaks.com/topic/61963-multiple-submit-buttons-on-one-page/#findComment-308634 Share on other sites More sharing options...
cooldude832 Posted July 27, 2007 Share Posted July 27, 2007 the way i handle multiple submit buttons (like a preview and submit sorta deal) is make 2 buttons that are input type submit with contrasting values and then i say if($_POST['submit'] == case1){//case 1} for example it lets you do as many as you want Link to comment https://forums.phpfreaks.com/topic/61963-multiple-submit-buttons-on-one-page/#findComment-308643 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.