I should be embarrased for asking this, but why isn't the form redirecting me to snooze2.php?reminderID=X when I submit? It seems to skip redirecting me to that GET value but it inserts the other GET value.
Here is my code:
Code: Select all
<form method = 'GET' action = 'snooze2.php?reminderID=<?php echo $_GET["reminderID"]; ?>'>
<select name = 'snoozeTime'>
<option value = '1'> 1 Minutes </option>
<option value = '5'> 5 Minutes </option>
<option value = '10'> 10 Minutes </option>
<option value = '15'> 15 Minutes </option>
<option value = '20'> 20 Minutes </option>
<option value = '30'> 30 Minutes </option>
<option value = '45'> 45 Minutes </option>
<option value = '60'> 1 Hour </option>
<option value = '120'> 2 Hours </option>
<option value = '240'> 4 Hours </option>
<option value = '1440'> 24 Hours </option>
<option value = '2880'> 48 Hours </option>
<option value = '10080'> 1 Week </option>
</select>
<input type = 'submit' value = 'Snooze'>
</form>
<?php
$snoozeTime = $_GET["snoozeTime"];
$reminderID = $_GET["reminderID"];
if (!empty($snoozeTime) && ctype_digit($snoozeTime)) {
$query = mysql_query("SELECT id, remindOn
FROM remindersWebCal
WHERE id = '$reminderID'");
while ($res = mysql_fetch_array($query)) {
$remindTimeFromDB = $res['remindOn'];
}
$newRemindTime = $remindTimeFromDB + $snoozeTime * 60;
mysql_query("UPDATE remindersWebCal
SET remindOn = '$newRemindTime'
WHERE id = '$reminderID'");
}snooze2.php?reminderID=x and then once the form is submitted the URL unexpectedly becomes snooze2.php?snoozeTime=x when I was hoping it to be snooze2.php?reminderID=x&snoozeTime=x.
If I place the expected URL in manually the code works.
Regards,