enterMeeting.php collects input.
checkMeeting.php displays the data and gives the user a chance to INSERT or Cancel.
processTwoButtons.php inserts the new record into the database with the values input into enterMeeting.php or return to enterMeeting.php if Canceled.
The problem is the values aren't being passed to the query properly. id increments okay, but name is null date is 0000-00-00 time is 00:00:00 and info-id is 0 no matter the values input into enterMeeting.php.
Thanks for your help.
Evil8
Code:
<?php
$username="me";
$host="me-meetingSchedual.mysql.me.com:3306";
$password="******";
$database="me-meetingSchedual";
mysql_connect($host,$username,$password);
@mysql_select_db($database) or die("Unable to select database");
$query = 'SELECT name FROM `place` '
. ' ORDER BY `name` ';
$result = mysql_query($query)
?>
<form action="checkMeeting.php" method="post">
Place:<br />
<select name='name'>
<?php
While($row = mysql_fetch_array($result))
{
extract($row);
echo "<option value='$name'>$name</option>\n";
}
?>
</select>
<br>
<br />
Date:<br />
<input name="date" type="text" maxlength="10" />
<br>
<br />
Time:<br />
<input name="time" type="text" maxlength="10" />
<br>
<br />
Info:<br />
<input name="info_id" type="radio" value="1" />
Blue Cross Blue Sheild Medicare Plans<br />
<input name="info_id" type="radio" value="2" />
Hummana Medicare Plans<br />
<input name="info_id" type="radio" value="3" />
Medica Medicare Plans<br>
<br />
<input type="submit" value="Submit Meeting" />
</form>
Code:
<?php
foreach($_POST as $field => $value)
{
echo "$field = $value<br />\n";
}
echo "<form action='processTwoButtons.php' method='POST'>
<input type='submit' name='display_button' value='Ok' />
<input type='submit' name='display_button' value='Cancel' />
</form>";
?>
Code:
<?php
if($_POST['display_button'] == "Ok")
{
$username="me";
$password="******";
$database="me-meetingSchedual";
mysql_connect("me-meetingSchedual.mysql.me.com:3306",$username,$password);
@mysql_select_db($database) or die("Unable to select database");
$query = "INSERT INTO `meeting` (id, name, date, time, info_id)
VALUES ('NULL','$_POST[name]','$_POST[date]','$_POST[time]','$_POST[info_id]')";
$result=mysql_query($query)
or die("Couldn't execute query.");
}
else
{
header( 'Location: [URL unfurl="true"]http://www.mediqwest.com/enterMeeting.php');[/URL]
}
?>
Thanks for your help.
Evil8