The form is submitting, but the $id variable is behaving strangely, while the $part variable is behaving as expected.
The first if statement works perfectly, but all of the rest will submit the $part variable, while setting the $id variable to "0". Any clue what could be happening?
<?php
$part = $_POST['participating'];
$form = $_POST['forms'];
$meth = $_POST['method'];
$id = $_POST['id'];
if ($meth == "Forms - Foo") {
$sql="INSERT INTO form_foo (id, participants, forms)
VALUES ('$id', '$part', '$form')";
$result = mysql_query($sql);
} else if ($meth=="Forms - Other") {
$sql="INSERT INTO form_other (id, participants)
VALUES ('$id', '$part')";
$result = mysql_query($sql);
} else if ($meth=="Online - Foo") {
$sql="INSERT INTO online_foo (id, participants)
VALUES ('$id', '$part')";
$result = mysql_query($sql);
} else {
$sql="INSERT INTO online_other (id, participants)
VALUES ('$id', '$part')";
$result = mysql_query($sql);
}
?>