Welcome Guest, Not a member yet? Register   Sign In
Best way to add/edit a listing
#7

[eluser]Rick Jolly[/eluser]
[quote author="CIfan1000" date="1225558135"]
PS before I made this post, I was looking at http://codeigniter.com/wiki/Add_Edit_Views/
[/quote]
Yea, there are a couple of problems with that code.

The following doesn't make sense:
Code:
function edit($department_id = NULL){
   if($department_id == NULL){ $department_id = $this->uri->segment(3); }
The $department_id parameter in the edit function would be segment 3. It's a redundant check. Also, there is no check to be sure that a record is returned from the database (that the $department_id was valid).

Another problem is the seperate save() method for the post action. What if that method was accessed via the url? There is no error checking to detect that.


Messages In This Thread
Best way to add/edit a listing - by El Forum - 10-31-2008, 06:06 PM
Best way to add/edit a listing - by El Forum - 10-31-2008, 06:30 PM
Best way to add/edit a listing - by El Forum - 10-31-2008, 06:47 PM
Best way to add/edit a listing - by El Forum - 10-31-2008, 09:30 PM
Best way to add/edit a listing - by El Forum - 11-01-2008, 03:15 AM
Best way to add/edit a listing - by El Forum - 11-01-2008, 05:48 AM
Best way to add/edit a listing - by El Forum - 11-01-2008, 10:13 AM
Best way to add/edit a listing - by El Forum - 11-01-2008, 10:58 AM
Best way to add/edit a listing - by El Forum - 11-01-2008, 12:06 PM
Best way to add/edit a listing - by El Forum - 11-01-2008, 06:23 PM
Best way to add/edit a listing - by El Forum - 11-01-2008, 06:24 PM
Best way to add/edit a listing - by El Forum - 11-01-2008, 07:14 PM



Theme © iAndrew 2016 - Forum software by © MyBB