throw new Exception("id not supplied");
This line throws the exception that causes the fatal error you’re seeing.
It’s run under this condition:
if(!isset($id)){
So obviously, the condition matches, which means that the $id
variable is not set.
Also, extract($_REQUEST)
is extremely bad practice.
Simple scope example:
function foo($a) {
$a = 5;
echo $a; //5
}
$a = 42;
echo $a; //42
foo($a); //will echo 5
echo $a; //Still 42. Different $a.
3
solved Fatal error: Uncaught exception ‘Exception’ with message ‘id not supplied’