Page 1 of 1

HTTP_post_VARS

Posted: Fri Feb 21, 2003 3:23 pm
by invincible
I am trying to use this function to return the date but its giving me null.
I am passing "receipt_day", "receipt_month", "receipt_year" in the date2 function and I
want it to extract values using the HTTP_POST_VARS function which is not working.
Can someone help






//receipt date
function date2($day, $month, $year)
{
$slash = "/";
$day1= GetSQLValueString($HTTP_POST_VARS[$day], "text");
$month1 = GetSQLValueString($HTTP_POST_VARS[$month], "text");
$year1 = GetSQLValueString($HTTP_POST_VARS[$year], "text");
$date1 = $day1. $slash.$month1.$slash.$year1;
echo $date1;
return $date1;
}





if ((isset($HTTP_POST_VARS["MM_insert"])) && ($HTTP_POST_VARS["MM_insert"] == "form2")) {
$insertSQL = sprintf("INSERT INTO nonimmi (current_visa, visa_applied, service_center, receipt, notice_day, notice_month, notice_year, RFE_day, RFE_month, RFE_year, RFE_submit_day, RFE_submit_month, RFE_submit_year, approval_day, approval_month, approval_year, final_status, comments) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)",
GetSQLValueString($HTTP_POST_VARS['current_visa'], "text"),
GetSQLValueString($HTTP_POST_VARS['visa_applied'], "text"),
GetSQLValueString($HTTP_POST_VARS['service_center'], "text"),
date2("receipt_day", "receipt_month", "receipt_year"),

Posted: Fri Feb 21, 2003 8:00 pm
by volka
unlike $_POST $HTTP_POST_VARS is not a superglobal. You have to use

Code: Select all

global $HTTP_POST_VARS;
at the top of your functions to have access to it, e.g.

Code: Select all

function abcde()
{
    global $HTTP_POST_VARS;
    return $HTTP_POST_VARS['abcde'];
}