J Joe New member May 20, 2009 #1 Hey guys, Need a small snippet of code for something I'm working on. I need a PHP IF statement that will check if a COOKIE(); contains a certain character, and if it doesn't find that character, use require(); else do nothing. Any ideas?
Hey guys, Need a small snippet of code for something I'm working on. I need a PHP IF statement that will check if a COOKIE(); contains a certain character, and if it doesn't find that character, use require(); else do nothing. Any ideas?
J JA12 New member May 20, 2009 #2 if (isset($_COOKIE['Name'],'c')) { if (!strripos($_COOKIE['Name'],'c')) { # true condition require(...); } } else { require(...); } $value = (strripos($_COOKIE['Name'],'c') ? $_COOKIE['Name'] : require(...));
if (isset($_COOKIE['Name'],'c')) { if (!strripos($_COOKIE['Name'],'c')) { # true condition require(...); } } else { require(...); } $value = (strripos($_COOKIE['Name'],'c') ? $_COOKIE['Name'] : require(...));