Within my form handler, I have a piece of code, that seems to stop me from picking up $POST[] or $REQUEST[] upon submission. It is called authcode and can be seen below (I simply get nothing)
$query = 'INSERT INTO subdomain_submission ('.implode(',', $fields).') VALUES ('.implode(',',$values).')';
mysql_query($query);
$id = mysql_insert_id();
# set cookies
if (!empty($id)) setcookie('authcode', $id, time() + 3600*24*365, '/');
}
else
{
$qryString = array();
$currentID = $_POST['id'];
unset($_POST['id']);
foreach ($_POST as $field=>$value)
{
$qryString[] = $field.' = "'.htmlspecialchars(trim($value)).'" ';
}
So, in order for me to do a calculation and INSERT a value into another field, depending on the value submitted by the form, I have to do it another way, besides using $_POST. (The exact thing I am doing, is submitting the narrative of the month, ie) March and converting it to the number, ie) 2 and inserting 2 into a field.
What I need to do, is upon submission, or MySQL record insert, I need to make the calculation and put it into the number field.
The narrative is put into the field age_mth
The calculated number will be put into the field age_month
Can someone point me in the right direction. I basically want to do this
FOR (last submitted record) {find the value in the age_mth field, pass it thru my lookup table, then insert the number value into the last submitted record's age_month field.}
I have the lookup table.
I have made guesses, but I think that it would just confuse the issue to post them as they are probably wrong. Thankyou