![]() |
No data inserted into database. Am I wrongdoing it?
I have a form named:"RegistrationForm.php". when i click the "submit button", there's a data inserted in the database (the prove is, there a new row in the database),
but there's no value from user textfield(ic_no,name,email...) that have been inserted. It means like there's a row of data inserted but without value.. p/s- however, when i click the submit button, it successfully directed me to the "BookingForm.php" with all the session value...it's just that there's no data inserted into the database. can someone straighten this up for me? am i doing wrong with the coding with the submit button? here's the code Code:
|
if you are using the same file to process form data you have first to check if the form is being submitted:
PHP Code:
|
For the luv of gawd, please don't forget to verify your data before you enter it into a database. At the very VERY least you should be sanitizing it with mysql_real_escape_string();
You're attempting to insert a row using POST information that isn't populated at the time of the statement. When the form submits (to BookingForm.php) you should be checking on that page for valid POST data. If none is found send them back to the form, if it is found, checked for validity and passes, then insert your sanitized input into the database. |
i do know that right now i'm passing the raw data into the database, but this is just the basic for me to see whether the form inserting will function or not.
i'm planning to make the form validating/ verifying the data after make sure that it completely success insert data into the database |
| All times are GMT. The time now is 06:36 PM. |
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0