limitphp Posted August 26, 2009 Share Posted August 26, 2009 I have this notice: Notice: Undefined variable: logout in C:\wamp\www\inc_login_script.php on line 11 I understand I can turn off these notices, but most of you have suggested I fix them instead. Here's my code for that line: //log user out if ($logout=="yes")//*********** DESTROY SESSION, DELETE COOKIE, DELETE ENTRY { //code here } I guess its giving me this notice because there will be sometimes when logout doesn't have a value. How should I fix this notice? thanks Link to comment https://forums.phpfreaks.com/topic/171983-solved-help-with-undefined-variable/ Share on other sites More sharing options...
Mark Baker Posted August 26, 2009 Share Posted August 26, 2009 if (isset($logout) && $logout == 'yes') Link to comment https://forums.phpfreaks.com/topic/171983-solved-help-with-undefined-variable/#findComment-906841 Share on other sites More sharing options...
limitphp Posted August 26, 2009 Author Share Posted August 26, 2009 if (isset($logout) && $logout == 'yes') thanks Link to comment https://forums.phpfreaks.com/topic/171983-solved-help-with-undefined-variable/#findComment-906842 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.