crameep Posted December 29, 2007 Share Posted December 29, 2007 <FORM ACTION="eventin.php" METHOD="post"> <?php $query = "SELECT eventtype FROM eventid WHERE enabled = 't'"; $result = mysql_query($query); // echo " <center> Buttons</center><BR>"; // echo $result; while($row = mysql_fetch_array($result, MYSQL_ASSOC)) { echo "<input type='submit' value='" . "{$row['eventtype']}" . " 'name='" . "{$row['id']}" . "'>"; } ?> Here is the Post page <?php include 'config.inc'; include 'opendb.inc'; include 'globals.inc'; ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title>Adding Event</title> </head> <body> Adding Event to list, <?php echo $HTTP_POST_VARS["eventtype"]; ?><br /> Adding Eventid to list, <?php echo $HTTP_POST_VARS["id"]; ?><br /> <?PHP $testpost = $HTTP_POST_VARS['eventtype']; echo $testpost . "Var Seen<BR>"; echo $_POST['id']; echo $_REQUEST['id']; import_request_variables('p', 'p_'); echo $p_eventtype; //mysql_query("INSERT INTO `events` VALUES ('$name', '$system', '$region', '$type', '')"); ?> </body> </html> When i click the buttons. i simply get the psot page with Adding event to list, Adding eventid to list, with none of the post results.. i'm wanting to insert these values into my database in another table, but i cant seem to get the post info to show.. I'd appritiate any help i can get Quote Link to comment https://forums.phpfreaks.com/topic/83567-simple-form-of-sorts/ Share on other sites More sharing options...
drummer101 Posted December 29, 2007 Share Posted December 29, 2007 <input type='submit' value='" Needs to be named Quote Link to comment https://forums.phpfreaks.com/topic/83567-simple-form-of-sorts/#findComment-425165 Share on other sites More sharing options...
crameep Posted December 29, 2007 Author Share Posted December 29, 2007 It is named, i actualy realized i posted the older version than the one im using... it goes type name value instead of multilined .. but same results Quote Link to comment https://forums.phpfreaks.com/topic/83567-simple-form-of-sorts/#findComment-425167 Share on other sites More sharing options...
drummer101 Posted December 29, 2007 Share Posted December 29, 2007 $test = $_POST['<itsname>']; Quote Link to comment https://forums.phpfreaks.com/topic/83567-simple-form-of-sorts/#findComment-425170 Share on other sites More sharing options...
crameep Posted December 29, 2007 Author Share Posted December 29, 2007 wow guys.. im sorry this is bad my copy and pasting went haywire.. heres what the psot page should have been This still does not return a result... <?php include 'config.inc'; include 'opendb.inc'; include 'globals.inc'; ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title>Adding Event</title> </head> <body> Adding Event to list, <?php echo $_POST["{$row['id']}"]; ?><br /> <?PHP $testpost = $_POST["{$row('id')}"]; echo $testpost . "Var Seen<BR>"; //mysql_query("INSERT INTO `events` VALUES ('$name', '$system', '$region', '$type', '')"); ?> </body> </html> Quote Link to comment https://forums.phpfreaks.com/topic/83567-simple-form-of-sorts/#findComment-425173 Share on other sites More sharing options...
drummer101 Posted December 29, 2007 Share Posted December 29, 2007 I don't see a form close in the first page, but I assume since you're making it to the second page, you have a submit button (also not defined) somewhere along with the form close? Quote Link to comment https://forums.phpfreaks.com/topic/83567-simple-form-of-sorts/#findComment-425175 Share on other sites More sharing options...
crameep Posted December 29, 2007 Author Share Posted December 29, 2007 Yes, there is a form close.. i didn't post the whole page that would be a mess. anyways.. each button should be a submit I think. if you look above where the button info is retrieved from the database you will see each type is submit. Quote Link to comment https://forums.phpfreaks.com/topic/83567-simple-form-of-sorts/#findComment-425179 Share on other sites More sharing options...
drummer101 Posted December 29, 2007 Share Posted December 29, 2007 Really it ought to just be $testpost = $_POST['*input name*']; Quote Link to comment https://forums.phpfreaks.com/topic/83567-simple-form-of-sorts/#findComment-425195 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.