Hi i am trying to get inputted responses from one page to another.
Input Page is shown below. This records and verifys the data fine:
if(isset($_POST['date'])) {
if($_POST['date'] == "confirmed") {
//set medalhistrorydate_month & medalhistrorydate_year
if(isset($_POST['medalhistorydate_month']))
$medalhistorydatemonth = $_POST['medalhistorydate_month'];
else
$medalhistorydatemonth = "0";
if(isset($_POST['medalhistorydate_year'])) {
$medalhistorydateyear = $_POST['medalhistorydate_year'];
if($medalhistorydateyear < 1900 || $medalhistorydateyear > 2100)
$medalhistorydateyear = "0000";
}
else
$medalhistorydateyear = "0000";
//set medalhistrorydate_continue to the end confirmation screen response
if($medalhistorydatemonth != "0") {
if($medalhistorydateyear != "0000") {
MuppetRedirectResult(GetAndReplaceLangStr($content['LN_CALCMEDALHISTORYACTION'],$medalhistorydatemonth,$medalhistorydateyear), "parser.php?year=" . $medalhistorydateyear . "&month=" . $medalhistorydatemonth . "&op=calcmedalhistoryonly", 3);
else
MuppetRedirectResult(GetAndReplaceLangStr($content['LN_CALCMEDALHISTORYYEARERROR'],$medalhistorydateyear), "calcmedalhistorydate.php", 3);
}
else
MuppetRedirectResult(GetAndReplaceLangStr($content['LN_CALCMEDALHISTORYMONTHERROR'],$medalhistorydatemonth), "calcmedalhistorydate.php", 3);
}
}
The function MuppetRedirectResult displays a message in a temproary webpage and then moves the webpage onto the specified one in the 2nd function input, the third is a delay timer.
It is the part where it sends it to the parser.php file that it is having issues. The address in the address bar of the parser.php is correct (parser.php?op=calcmedalhistoryonly&month=5&year=2007). But the below code in parser.php can only pickup the 'op' varibale and not the year or month (i have tried other words incase these where locked in php as special):
if ( isset($_GET['op']) )
$parseroperation = DB_RemoveBadChars($_GET['op']);
else
$parseroperation = "";
if ( isset($_GET['op']) )
{
if($parseroperation == 'calcmedalhistoryonly') {
//Added by Muppet - create the medal history bits
if(isset($_GET['month']))
$medalhistorydatemonth = $_GET['month'];
else
$medalhistorydatemonth = "0";
if(isset($_GET['year']))
$medalhistorydateyear = $_GET['year'];
else
$medalhistorydateyear = "0000";
if($medalhistorydatemonth != "0" && $medalhistorydateyear != "0000")
CreateAllMedalHistory(-1, $medalhistorydateyear, $medalhistorydatemonth);
else if($medalhistorydatemonth == "0")
DieWithErrorMsg("Error, bad month: " . $medalhistorydateyear . " : " . $medalhistorydatemonth);
else
DieWithErrorMsg("Error, bad year: " . $medalhistorydateyear . " : " . $medalhistorydatemonth);
}
}
The above code reconises the 'op' but fails on the other two and so displays in the built in error message a year of "0000" and a month of "0" (my failback values).
Anyone have any idea, I am trying to add this into existing code.