PHP function missed argument error?

Lolzar

New Member
In PHP I allow the user to enter a url and load a file, function, parameters accordingly with a simple routing file.

A Url of http://localhost/user/edit/1 will call the file user.php and the function edit() inside it and pass the parameter 1 to it. If the user removed the argument 1 and the preceeding slash so a function missing argument error will appear which I don't like.I tried exception handling like this.

\[code\]<?phptry { call_user_func($action,$params);} catch (Exception $e) { echo "You followed a wrong URL to get to this page";}?>\[/code\]

but this doesn't work and the php warning will appear. How can I hide this ?
 
Back
Top