Inserting data from a form(what evrybody seems to have forgotten),help a newbie for a better today |
[eluser]phpserver[/eluser]
View::: myform.php Controller <? class Arc extends Controller { //Validation function included function insert_into_mysql() { //Help } } ?> Model <? class Model extends Controller{ function insert() { //help } } ?> I have spent a whole week trying to insert data from a form into mysql,i have failed terribly. I am used to using '$_POST[email]' format when posting data and nothing so far works. I want to insert email and username into a database from a form as you can gather from above. Will somebody come to my resque,its friday goddamn it,it has been a long five days.
[eluser]Colin Williams[/eluser]
Try harder. Read the User Guide. Extrapolate
[eluser]new developer[/eluser]
Your model Code: function insert(){ your controller Code: function create(){
[eluser]a&w[/eluser]
What @new developer posted seems to circumvent the form validation's sanitization, etc., just grabbing the raw post data. You might want to check this thread: http://ellislab.com/forums/viewthread/97045/ (and follow your nose to the linked thread in #2 where this is discussed further).
[eluser]Colin Williams[/eluser]
Any sanitation CI does happens directly on the $_POST super-global. But even so, the model shouldn't have to go sniff out data from the HTTP request. The controller should supply it. |
Welcome Guest, Not a member yet? Register Sign In |