Welcome Guest, Not a member yet? Register   Sign In
Page Refresh poblem
#6

[eluser]boltsabre[/eluser]
On a side note, this is a good example of why you should be validating your input!!!

I'm sure that at least one of your inputs MUST be entered by the user? Otherwise what is the point of even having the form???

As your current code stands a user can come to this page, click submit, insert a blank row of data into your table (ouch) and be successfully redirected.

Also...

If you just name your inputs the same as your table column names you can just do this, instead of all that "assigning inputs to variables, and then inserting those variables into an array and then finally passing the array to your model call" (LOTS AND LOTS of unneeded code that is just waiting to create bugs and unneeded variables sucking up server resources and processing time).
Code:
$this->load->model('dbmodel');
$this->dbmodel->update_entry($this->input->post(), $this->session->userdata('id'));

If you do need to get your post variables into an array for whatever reason, there is no need to assign them to a variable first, you can do it like this:
Code:
$data = array('uname'=>$this->input->post('e_uname'),...


Messages In This Thread
Page Refresh poblem - by El Forum - 09-07-2012, 04:32 AM
Page Refresh poblem - by El Forum - 09-07-2012, 05:56 AM
Page Refresh poblem - by El Forum - 09-07-2012, 06:02 AM
Page Refresh poblem - by El Forum - 09-07-2012, 06:44 AM
Page Refresh poblem - by El Forum - 09-07-2012, 06:52 AM
Page Refresh poblem - by El Forum - 09-07-2012, 07:01 AM
Page Refresh poblem - by El Forum - 09-07-2012, 07:25 AM



Theme © iAndrew 2016 - Forum software by © MyBB