Undefined Variable in Security code!!!!
Posted: Tue Sep 16, 2014 2:46 pm
Hello again, members of the PHP Technorati. Again I come seeking your guidance on a matter of php syntax. I
keep getting this error code:
PHP Parse error: syntax error, unexpected T_VARIABLE
Here is the code:
Something is missing. Please enlighten me as to what I am doing wrong.
Thanks in advance.
Batoe
keep getting this error code:
PHP Parse error: syntax error, unexpected T_VARIABLE
Here is the code:
Code: Select all
function myRouter($urls){
$urls=array( 1 =>'about.php',
2 =>'photos.php',
3 =>'contact.php',
4 =>'home.php'
);
if (in_array($_GET['page'],array_keys($urls))) {
readfile $urls[$_GET['page']];
} else {
readfile $urls[4];
}
}
echo myRouter() ;
Thanks in advance.
Batoe