Hi all,
I am having a problem with $HTTP_POST_VARS. I have a form like so;
<form name="<?php echo $row_Songs['sid'];?>" method="post" action="songs.php?test=<?php echo $row_Songs['sid'];?>">
<input name="votes" type="hidden" value="<?php echo $row_Songs['votes'];?>">
<input type="submit" name="Submit" value="Vote">
</form></td>
Which should POST the form to songs.php setting the variable 'test' to $row_Songs['sid'] and the other variable 'votes' to $row_Songs['votes']
Then, at the top of songs.php I have the following;
if (isset($HTTP_POST_VARS["test"]))
{
$vot = $HTTP_POST_VARS["votes"];
++$vot;
$updateSQL = sprintf("UPDATE ideas SET votes=%s WHERE sid=%s",
GetSQLValueString($vot, "int"),
GetSQLValueString($HTTP_POST_VARS["test"], "int"));
mysql_select_db($database_main, $main);
$Result1 = mysql_query($updateSQL, $main) or die(mysql_error());
}
This should register the fact that I have POSTed the variables 'test' and 'votes' and update the database accordingly, right? Except it doesn't, further examination reveals that the POST variable 'test' has not been set. Wierdly though, if I change $HTTP_POST_VARS to $HTTP_GET_VARS, then it works! (I don't need to change the form to GET, just the handler.)
Is this just some wierd quirk of PHP (I'm very new to it) or am I missing something obvious? Any help is greatly appriciated.
Regards
David