top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Resolving a PHP Notice Error

+1 vote
271 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
0 votes

recently I have made a form code and attached modules to it. but soon after I have reached an error saying Notice: Undefined index: module in F:\website\webpage\gate.php on line 68

here is the line that was mentioned

   switch ($_GET["module"]) {
    case "settings":
      Include('settings.php');
      break;
    default:
      break;
   }

I am also mentioning the code in the that I showed up ib the link

<a class="nav-link" href="gate.php?module=settings"> Settings </a>

please rectify this error for me and sorry for any in trouble

+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?

...