burger97979 burger97979 - 4 years ago 76
HTML Question

PHP Empty 500 Error

I have this code to check if any input values are left empty, but for some reason the page keeps spitting out a 500 error ( and even with error reporting, it will only give me a 500 error ).

Here's my code

PHP


function checkInput() {
echo 'There are one or more errors with your application';
if (empty($_POST['MINGNAME'])) {
die('Please fill in your in-game name<br>');
} elseif (empty($_POST['MSTEAMID'])) {
die('Please fill in your Steam-ID ( by signing in through Steam )<br>');
} elseif (empty($_POST['MAGE'])) {
die('Please fill in your age<br>')
} elseif (empty($_POST['MULX1'])) {
die('Please fill out the first ULX command<br>');
} elseif (empty($_POST['MULX2'])) {
die('Please fill out the second ULX command<br>');
} elseif (empty($_POST['MULX3'])) {
die('Please fill out the third ULX command<br>');
} elseif (empty($_POST['MULX4'])) {
die('Please fill out the fourth ULX command<br>');
} elseif (empty($_POST['MULX5'])) {
die('Please fill out the fifth ULX command<br>');
} elseif (empty($_POST['MSIT1'])) {
die('Please fill out your first situational<br>');
} elseif (empty($_POST['MSIT2'])) {
die('Please fill out your second situational<br>');
} elseif (empty($_POST['MSIT3'])) {
die('Please fill out your third situational<br>');
} elseif (empty($_POST['MSIT4'])) {
die('Please fill out your fourth situational<br>');
} elseif (empty($_POST['MSIT5'])) {
die('Please fill out your fifth situational<br>');
} else {
echo '';
}
}
checkInput();


I have no idea what's wrong with my code.
Any help would be greatly appreciated.

Answer Source

You're missing a semicolon on line 10:

} elseif (empty($_POST['MAGE'])) {
    die('Please fill in your age<br>') /* Here */
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download