Sunday, 15 May 2011

PHP File automatically saves blank inputs in my Database -


Good day, every time I refresh my php file, always shows a successful alert, even submitting Before I press the button, I am showing empty figures in my DB.

I need help, because there is no warning or error in it. Thanks in advance for helping.

PHP:

  session_start (); 'Connect.fp' is required; If (empty ($ _ POST ['first name'])) $ Firstname = ''; Else $ FirstName = ($ _POST ['first name']); If (empty ($ _ POST ['LastName'])) $ LastName = ''; And $ last name = ($ _POST ['last name']); If (empty ($ _ POST ['gender'])) $ gender = ''; And $ gender = ($ _POST ['gender']); If (empty ($ _ POST ['username'])) $ user name = ''; And $ username = ($ _POST ['username']); If (empty ($ _ POST ['password'])) $ password = ''; Else $ password = ($ _POST ['password']); If (empty ($ _ POST ['reEnterPassword'])) $ reEnterPassword = ''; Else $ reEnterPassword = ($ _POST ['reEnterPassword']); If ($ _ POST ['EmailAdd'])) $ EmailAdd = ''; Else $ add email = ($ _POST ['EmailAdd']); If (empty ($ _ POST ['reEnterEmailAdd'])) $ reEnterEmailAdd = ''; Else $ reEnterEmailAdd = ($ _POST ['reEnterEmailAdd']); $ Sql ​​= "Users (First Name, Last Name, Username, Password, Repeat Password, EmailAdd, ReenterMeMed) values ​​('$ first name', '$ last name', '$ user name', '$ password', ' $ ReEnterPassword ',' $ add email ',' $ reEnterEmailAdd '); "; $ Result = mysql_query ($ sql); If (! $ Result) {dead ('invalid input:' mysql_error (. $ Sql); } Else {echo "