I can't figure out how to get the passed in variable. For example, I call the below page DBInput.php?Day=100303
I want to insert the Day variable into my mySQL DB. Here's the code...
<?php
if (isset($REQUEST['submit'])) {
mysql_connect('localhost','mike','111kl2');
mysql_select_db('RandomDBs');
mysql_query("INSERT INTO messages (name,email,message,Date) VALUES ('" .
$REQUEST['name'] ."','" . $REQUEST['email'] . "','" . $REQUEST['message'] . "','" .
$REQUEST['Day'] . "')");
header("Location: DBinput.php");
} else {
print<<<HTML
<form method="POST" action="$SERVER[PHP_SELF]">
<table>
<tr><td>Name:</td><td><input type="text" name="name"></td></tr>
<tr><td>Email:</td><td><input type="text" name="email"></td></tr>
<tr><td>Comment:</td><td><textarea name="message" COLS="30" ROWS="10"></textarea></td></tr>
<tr><td colspan="2"><input name="submit" onClick="window.close()" value="Submit Comment" type="submit"></td></tr>
<tr><td colspan="2"><input type="hidden" name="Day" value="$Day" ></td></tr>
</table>
</form>
HTML;
}
?>
The hidden type value is what I can't figure out. This line <input type="hidden" name="Day" value="$Day" > . How do I get that the URL variable?