JoshuaLuke
Posting Freak
- Jan 29, 2012
- 529
- 51
Hey,
I'm making staff apps for Uber, the data from the POST vars insert fine, but they all have to be set according to my PHP, but when they're not set the data still inserts into the database. Also, i'm unsure about how to display a message if a field isn't set.
Here's my code:
Cheers
I'm making staff apps for Uber, the data from the POST vars insert fine, but they all have to be set according to my PHP, but when they're not set the data still inserts into the database. Also, i'm unsure about how to display a message if a field isn't set.
Here's my code:
Code:
if (isset($_POST["q1"]) && isset($_POST["q2"]) && isset($_POST["q3"]) && isset($_POST["q4"]) && isset($_POST["q5"]) && isset($_POST["q6"]) && isset($_POST["q7"]) && isset($_POST["q8"]) && isset($_POST["q9"]) && isset($_POST["q10"])&& isset($_POST["q11"]) && isset($_POST["q12"]) && isset($_POST["q13"]) && isset($_POST["q14"]) && isset($_POST["q15"]))
{
dbquery("INSERT INTO `applications` (`username`, `q1`, `q2`, `q3`, `q4`, `q5`, `q6`, `q7`, `q8`, `q9`, `q10`, `q11`, `q12`, `q13`, `q14`, `q15`, `q16`) VALUES ('".USER_NAME."','".$_POST['q1']."', '".$_POST['q2']."', '".$_POST['q3']."', '".$_POST['q4']."', '".$_POST['q5']."', '".$_POST['q6']."', '".$_POST['q7']."', '".$_POST['q8']."', '".$_POST['q9']."', '".$_POST['q10']."', '".$_POST['q11']."', '".$_POST['q12']."', '".$_POST['q13']."', '".$_POST['q14']."', '".$_POST['q15']."', '".$_POST['q16']."')");
}
Cheers