Jump to content

Notice: Undefined index: mode


Texan78

Recommended Posts

Hello, forgive me for this question in advance. I have looked all day for a fix to this and nothing I have come across has resolved this. My host upgraded to the most recent PHP several months ago and since it has thrown errors on certain scripts. I have gotten tired of looking at them and haven't been able to find a fix on my own so here I am. I am getting the below error. 

 

Notice: Undefined index: mode in /home4/mesquiu0/public_html/NSDisplay/NSStorms-include.php on line 38

if ($_REQUEST['mode'] == 'expired') {                    // We only want the expired storms
	$filetoRead = $expiredfile;
	$arraytoUse = $Expired;
} else {
	$filetoRead = $stormfile;
	$arraytoUse = $Active;
}

I am pretty sure it needs an inset call but not sure how to go about formatting that as I have done with the others errors I have come across. Any suggestions to this error?

 

-Thanks!

Link to comment
https://forums.phpfreaks.com/topic/292668-notice-undefined-index-mode/
Share on other sites

Disregard, I am an idiot and got it sorted. 

 

Changed this....

if ($_REQUEST['mode'] == 'expired')

To this....

if (isset($_REQUEST['mode']) == 'expired')

Errors are now resolved. Guess I was having a brain fart and was putting the closing ) in the wrong place. Sorry for the question. 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.