Gayner Posted November 23, 2009 Share Posted November 23, 2009 cause isset only works if i use numbers but i want to use isset and use letters to but it only works on numbers especially like if(isset($_COOKIE['skinid']) == 1) like if i use if(isset($_COOKIE['skinid']) == "heelo") it wont work Quote Link to comment https://forums.phpfreaks.com/topic/182581-only-way-ican-undefined-index-is-isset/ Share on other sites More sharing options...
robert_gsfame Posted November 23, 2009 Share Posted November 23, 2009 if you have created a cookie, why should put isset? if($_COOKIE["blabla"]=='yahoo00' Quote Link to comment https://forums.phpfreaks.com/topic/182581-only-way-ican-undefined-index-is-isset/#findComment-963674 Share on other sites More sharing options...
Gayner Posted November 23, 2009 Author Share Posted November 23, 2009 bcz if i put that, that stupid ass unidefined index error will pop up. all i want to know is how the helld o i make this shorter? why do i have to all this .... stupid isset is a stupid function burn in hell! if(isset($_COOKIE['skinid']) && $_COOKIE['skinid'] == 'default') { echo '<style type="text/css" media="all">@import url(1.css);</style>'; } if(isset($_COOKIE['skinid']) && $_COOKIE['skinid'] == 1) { echo '<style type="text/css" media="all">@import url(2.css);</style>'; } if(!isset($_COOKIE['skinid'])) { echo '<style type="text/css" media="all">@import url(2.css);</style>'; } why do i have to use this only way it works w/o unidenified index errors. Quote Link to comment https://forums.phpfreaks.com/topic/182581-only-way-ican-undefined-index-is-isset/#findComment-963675 Share on other sites More sharing options...
premiso Posted November 23, 2009 Share Posted November 23, 2009 isset returns a boolean, if you want to check the data in a cookie do this: if(isset($_COOKIE['skinid']) && $_COOKIE['skinid'] == "heelo") Will work, as it first checks if the cookie isset if it is then it tests the data in that cookie. Quote Link to comment https://forums.phpfreaks.com/topic/182581-only-way-ican-undefined-index-is-isset/#findComment-963679 Share on other sites More sharing options...
Gayner Posted November 23, 2009 Author Share Posted November 23, 2009 isset returns a boolean, if you want to check the data in a cookie do this: if(isset($_COOKIE['skinid']) && $_COOKIE['skinid'] == "heelo") Will work, as it first checks if the cookie isset if it is then it tests the data in that cookie. why the hell . i dont want to use isset.. while i code my website i aint putting isset around all ym stuff that's ridicilous is there another way so that IT DOESNT POP UP UNIDENTIFIED INDEX ERRORS PLZ Quote Link to comment https://forums.phpfreaks.com/topic/182581-only-way-ican-undefined-index-is-isset/#findComment-963680 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.