I have three different forms on a single page. Each form's data will be entered into a different table. For the first one I created I'm using this if
statement to insert the data into the table:
if ( $_SERVER['REQUEST_METHOD'] === 'POST' ) {
$band_name = $_POST['bandname'];
$band_website = $_POST['website'];
$band_descrip = $_POST['description'];
query(
"INSERT INTO bands(bandname, website, description) VALUES(:bandname, :website, :description)",
array('bandname' => $band_name, 'website' => $band_website, 'description' => $band_descrip),
$conn
);
} else {
$status = "Fill out the form";
}
I am assuming I need to create three different versions of the if
statement, one for each form. How can I specify which form was submitted?