Welcome Guest, Not a member yet? Register   Sign In
Error Reporting and index function parameters
#1

[eluser]aeternuslibertas[/eluser]
Hi all. I currently have a link on my site's navigation that looks like this:
mywebsite.com/controller (nothing new here)

When the user clicks on the link and the index function runs, the index function determines the city of the user based on the IP address, however this is not always accurate, so when the view is loaded up I also include the option to change the location to the 1 of 5 closest cities in the surrounding area with respect to the already determined city.

If the user decides to choose one of the 5 cities, then I run it like so:
mywebsite.com/controller/near/city_clicked_on

My question/dilemma is.....

I would like to have it set so I can just run it like this:
mywebsite.com/controller/city_clicked_on

however if I add the parameters to the index function I receive an error stating that the parameters are blank...which they are.

I fixed this by
Code:
adding error_reporting(0);

Is this a safe approach to implement?

my "near" function is the same as the "index", same code just with the addition to handle parameters. I don't want my controller to bigger than it has to be. But I don't know if adding the
Code:
error_reporting(0);
is a good thing to do in order to allow my index to run with empty parameters.
What do you guys think?




Theme © iAndrew 2016 - Forum software by © MyBB