Jump to content

Simple... Form of sorts


crameep

Recommended Posts

<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

Link to comment
https://forums.phpfreaks.com/topic/83567-simple-form-of-sorts/
Share on other sites

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>

Link to comment
https://forums.phpfreaks.com/topic/83567-simple-form-of-sorts/#findComment-425173
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.