I have some lines of code like this;
A.
if ( isset($_GET["logout"]) && $_GET["logout"] == 1){
do_something;
}
I replace with ( to get rid of the warning) ;
B.
if ( isset( filter_input(INPUT_GET,'logout',FILTER_SANITIZE_NUMBER_INT) ) &&
filter_input(INPUT_GET,'logout',FILTER_SANITIZE_NUMBER_INT) == 1){
do_something;
}
but i end up breaking the application with B. The login screen does not even appear. No error in the apache error log as well.
This is the sample url;
http://192.168.0.91/test-app/?logout=1
What is wrong with my B. syntax/code? I guess i am using filter_input wrongly?
Update1:
php version ->php5-5.4.20-34.3.x86_64 netbeans version -> 8.0.1
Code B. was fixed by changing to ;
Application runs fine now.
The inspiration for this fix is a fantastic article at http://kunststube.net/isset/ by David Zentgraf. Wish there was a way to contact him to thank him but ... apparently he is a regular here.
Thanx Bro :)