Jump to content

[SOLVED] php form post method???


will35010

Recommended Posts

I cannot get this script to pass the post value shows. I'm trying to echo it to see it getting passed. Any help would be appreciated. :)

 

<?php

//PHP script to see events from database

 

//This will give us very good details on errors

error_reporting(E_ALL);

 

require 'include/config.php';

require 'include/opendb.php';

 

//Return the Form Data from the Database

$query = "SELECT eventname FROM events ORDER BY eventID";

 

$result = mysqli_query($conn, $query) or die('Error: ' . mysql_error());

if (!$result) {

  echo 'Could not run query: ' . mysql_error();

  exit;

}

 

echo "<select name='shows' style='width:210px;'>\n";

 

while ($row = mysqli_fetch_row($result)) {

//assign varible names to results

$event = $row[0];

 

echo "<option value='{$event}'>$event</option>";

}

echo "</select>\n";

?>

<form method="POST" Action="<?php echo $_SERVER['PHP_SELF'];?>">

<input type="submit" value="Choose Play">

</form>

<?php

//take POST value to pick times

//if (isset ($_POST['shows'])) {

echo $_POST['shows'];

 

 

 

?>

<?php

include 'include/closedb.php';

?>

 

Link to comment
https://forums.phpfreaks.com/topic/131017-solved-php-form-post-method/
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.