will35010 Posted November 1, 2008 Share Posted November 1, 2008 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 More sharing options...
will35010 Posted November 1, 2008 Author Share Posted November 1, 2008 bump Link to comment https://forums.phpfreaks.com/topic/131017-solved-php-form-post-method/#findComment-680195 Share on other sites More sharing options...
revraz Posted November 1, 2008 Share Posted November 1, 2008 Because there is nothing in your FORM <form method="POST" Action="<?php echo $_SERVER['PHP_SELF'];?>"> <input type="submit" value="Choose Play"> </form> Link to comment https://forums.phpfreaks.com/topic/131017-solved-php-form-post-method/#findComment-680201 Share on other sites More sharing options...
will35010 Posted November 1, 2008 Author Share Posted November 1, 2008 Thanks I'm a moron!!! Link to comment https://forums.phpfreaks.com/topic/131017-solved-php-form-post-method/#findComment-680218 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.