Why have you dropped the $_POST superglobal variable assignments? That's how the data is passed from the function. Also, the mysql_real_escape_string() should be after a mysql connection.
// Replace this
if(isset($_POST['submitButton']))
// With this
if(!empty($_POST))
// Then check for values/forms. Some IE versions don't send the submit button
Quote:
Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.
if you're getting "white screened", it's usually because the PHP encountered a problem whilst executing, and you don't have error reporting on. Check your error log.
// Replace this
if(isset($_POST['submitButton']))
// With this
if(!empty($_POST))
// Then check for values/forms. Some IE versions don't send the submit button
Quote:
Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.
Why are you casting $c to a float btw? Also, you shouldn't really mix your coding styles (concerning your two different if styles). In my opinion, curly brackets are ALWAYS the best, so i'd suggest using that for all your if statements.
// Replace this
if(isset($_POST['submitButton']))
// With this
if(!empty($_POST))
// Then check for values/forms. Some IE versions don't send the submit button
Quote:
Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.