Welcome Guest, Not a member yet? Register   Sign In
Trouble With Form Helper and Databases
#1

[eluser]Bl4cKWid0w[/eluser]
I have a form that submits new information into the database. The only problem is that it's trying to submit the value of the submit input button into the database. Since the name of the button is 'confirm', this causes my script to work incorrectly since there is no such table field. I also tried using form_submit(), but that didn't seem to work either. Anyone have any ideas?
#2

[eluser]cideveloper[/eluser]
Code snippet would help us help you. Is your controller method iterating through all post fields and using the name value as the field value in the database?
#3

[eluser]Developer13[/eluser]
Don't pass the entire $_POST array to the database.
#4

[eluser]julgus[/eluser]
You can clean the $_POST array using unset($_POST[element]) and end up with a structure which you can use in the function update_string

Regards
#5

[eluser]lmv4321[/eluser]
Passing the entire $_POST array to the database is a bad idea as it makes you vulnerable to XSS attacks.




Theme © iAndrew 2016 - Forum software by © MyBB