I'd write:
PHP Code:
<?php
if ($_GET['p'] == 'submitted') {
$adminUserName = mysql_real_escape_string(stripslashes($_POST['adminuser']));
$adminPassword = mysql_real_escape_string(stripslashes($_POST['adminpass']));
$query = "INSERT INTO `mycms` set adminuser='$adminUserName', adminpass='$adminPassword'";
if (mysql_query($query)) {
//Insert successful
} else {
//Insert failed.
echo "Unable to add admin. MySQL reported "".mysql_error().""<br />";
}
}
?>
Please note that everything I changed was for a specific reason. Let me know if you have any specific questions.