Xtremer360 Posted February 29, 2012 Share Posted February 29, 2012 Trying to figure out where my syntax error is. Also to know I'm using code igniter but I don't think that changes anything. if (isset(cookie('xtrcook')) AND (!empty(cookie('xtrcook'))) || trim(cookie('xtrcook') !== '') || (cookie('xtrcook') !== NULL) || (!is_numeric(cookie('xtrcook')))) http://codeigniter.com/user_guide/helpers/cookie_helper.html Link to comment https://forums.phpfreaks.com/topic/257994-cookie-syntax-error/ Share on other sites More sharing options...
creata.physics Posted February 29, 2012 Share Posted February 29, 2012 What's your error verbatim? Link to comment https://forums.phpfreaks.com/topic/257994-cookie-syntax-error/#findComment-1322422 Share on other sites More sharing options...
codebyren Posted February 29, 2012 Share Posted February 29, 2012 Well, unless you have defined a "cookie" function, I don't believe CodeIgniter has one for you. So cookie('xtrcook') may fail anyway. You probably want something like this: <?php $cookie = trim($this->input->cookie('xtrcook')); // Or with the cookie helper functions (not really necessary) // $cookie = trim(get_cookie('xtrcook')); if ( ! $cookie || ! is_numeric($cookie)) { die('bad cookie'); } ?> Otherwise, as creata.physics said, what is the exact error you are getting? Link to comment https://forums.phpfreaks.com/topic/257994-cookie-syntax-error/#findComment-1322429 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.