Welcome Guest, Not a member yet? Register   Sign In
Best way to handle missing url parameters
#2

[eluser]frist44[/eluser]
I would definitely say to add code to controllers. Many of my parameters are databases record IDs. As part of the sql statement, I generally check to see if the array came back empty. If so, I redirect to my 404 error, or just back to the home page or something. There's no need to add additional code, just make sure the data is there. Or, if you're not dealing with SQL data arrays, just assign the parameter to a default of FALSE and test if false, meaning that nothing was passed in.


Messages In This Thread
Best way to handle missing url parameters - by El Forum - 05-25-2010, 12:10 AM
Best way to handle missing url parameters - by El Forum - 05-25-2010, 07:33 AM



Theme © iAndrew 2016 - Forum software by © MyBB