• Register
0 votes

Problem :

I am new to PHP. When I am trying to execute my PHP code then I am facing below error
( ! ) Fatal error: Cannot use isset() on the result of a function call (you can use "null !== func()" instead) in C:\Users\ mphil\Documents\NetBeansProjects\video-site\app\detect.php on line 45
Call Stack
#   Time    Memory  Function    Location
1   0.0000  234208  {main}( )   ..\index.php:0
Please help me in fixing this issue.
8 4 2
2,300 points

1 Answer

0 votes

Solution :

I have faced such warnings many times in past so my suggestion will be to ignore many of your NetBeans warnings, as IDE doesn't know, how will you use your inputs or variables. It will just warn you about the best practices that you should follow while coding in IDE, which is not necessary the best option for your code.

If you are using the filter_input(), then you don't need to use the isset() additionally. As the filter_input() is already doing the job for you.

So my suggestion for you is that you should just remove the isset() and your code will do the job for you. And in addition to that if you want to check if your value was set to apply your alternative values. Then you can use empty() function it will return FALSE to you when your value returned by the filter_input() is NULL / FALSE. So you can just negate your condition to match your case.

5 2 1
4,980 points

Related questions

0 votes
1 answer 16 views
Problem: Hello guys, I was learning the function in python, and wondering can we use function within a function then I google some stuff then got to know that function within the function is better way of implementing the algorithm we are implementing, can you guys please show it with an example.
asked Jun 5 Gavin 15.3k points
0 votes
1 answer 8 views
What i am attempting to make a easy connection with XAMPP and MySQL server, however whenever I attempt to enter data or connect to the database, i obtain this error. Why this is happen and how to solve it?
asked Sep 14 Daniel Anderson 4k points
0 votes
1 answer 14 views
can someone help me why i am seeing “PHP Fatal error: Uncaught Error: Call to undefined function mysql_query() in /Applications/MAMP/htdocs/lprapp/config.php:23 Stack trace:#0 {main} thrown in /Applications/MAMP/htdocs/lprapp/config.php on line 23&rdquo” this error and how to resolve it.
asked Sep 14 Daniel Anderson 4k points