You've helped me greatly..
I ended up changing a bit of the code.. It really helped me a lot..
But I do have one more thing to ask.. Is there a way to have another table updated depending on if the swimming pool or whirlpool was selected?
have all the code work the way it does now. BUt if someone selects Swimming pool radio button, Update a different table with a 1. And if Whirlpool is selected it will update that same table?
Here's is my code as it stands now.
<?php
include("connect.php");
if (!isset($_POST['submit']))
{
echo '
<form action="" method="POST">
<input type="radio" name="type" value="Pool">Swimming Pool</input> <input type="radio" name="type" value="Whirl">Whirlpool</input>
<select name="month">
<option value="January_">January</option>
<option value="February_">February</option>
<option value="March_">March</option>
<option value="April_">April</option>
<option value="May_">May</option>
<option value="June_">June</option>
<option value="July_">July</option>
<option value="August_">August</option>
<option value="September"_>September</option>
<option value="October_">October</option>
<option value="November_">November</option>
<option value="December_">December</option>
</select> <input type="submit" name="submit" value="Load">
<a href="" onclick="printpage();">Print page</a>
</form>
';
}
else
{
$month = $_POST['month']; // Grab the current Month
// $monthName = date("F",mktime(0, 0, 0, $month, 1, date('Y'))); // Grab the current Month Name
$type = $_POST['type'];
if (($type == "Pool" || $type == "Whirl")) {
$insertData = $month.$type; // for instance, w10
echo '<head><meta http-equiv="refresh" content="2; URL=index.php"></head>You selected '.$month.'<br />Reloading in 2 seconds or click here: <a href="index.php">Main Page</a>';
$update = mysql_query("UPDATE Pool_Config SET Selected_Month='".$insertData."' WHERE Monthid='1'")
or die(mysql_error());
} else {
die("Invalid Data Posted!");
} // end if
}
?>
This works great.. If someone selects Whirlpool and January. the table is updated to: January_Whirl
I like that...
But now for another part of the site I need a selection added.
Basically, if Someone selects Swimming Pool & March,
Selected_Month is updated to: March_Pool
Selected_Pool is updated to 1 (If Swimming Pool is selected, enter 1, if Whirlpool is selected enter 2)
Is there a way to make both updates?