top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration Why to Join

Facebook Login
Site Registration

Resolving a PHP Notice Error

+1 vote
35 views

I am wanting to establish a default sort by preference when the user hasn't specified one. I setup to test this with:

But I am receiving a Notice error:

Notice: Undefined variable: sort_by_preference in GIFI_codes.php on line 11- Line 11 is if ( !is_set( $sort_by_preference ) )

What is the correct way to test this without triggering a Notice error?

posted Sep 17, 2013 by Deepak Dasgupta

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

Because actually you are looking for isset() (not is_set()).
Try something like

( !isset( @$sortbypreference ) )
answer Sep 17, 2013 by Salil Agrawal
Similar Questions
+1 vote

Getting the following two error -
Warning:session_start() : cannot send session cookie - headers already sent by(output started at.......)
Warning:session_start() : cannot send session cache limiter - headers already sent by(output started at.......)

+1 vote

I have changed my Php version from 7 to 5.
I got this error ==>

mcrypt_encrypt(): Key of size 10 not supported by this algorithm. Only keys of sizes 16, 24 or 32 supported

How to fix this?

Contact Us
+91 9880187415
sales@queryhome.net
support@queryhome.net
#280, 3rd floor, 5th Main
6th Sector, HSR Layout
Bangalore-560102
Karnataka INDIA.
QUERY HOME
...