Cookies

These NetCloak commands refer to cookies.

<SET_COOKIE CookieName = Value>

<?php SetCookie("MyCookie","red"); ?>.

SetCookie( cookie, value )

SetCookie() is defined in PHP. It must be called before any headers are sent. (Must be before <HTML>, <HEAD>, and <BODY> tags.) In PHP3, calls made to setcookie() are preformed in the reverse order. PHP4 fixes the bug.

<INSERT_COOKIE CookieName>

The value of my cookie is <?php InsertCookie("MyCookie"); ?>.

InsertCookie( cookie )

<?php //----------------------------------------------------- // InsertCookie($cookie) // - - - - - - - - // Prints the value of the cookie $cookie. //----------------------------------------------------- function InsertClient($cookie) { print $HTTP_COOKIE_VARS[$cookie]; } ?>

<SHOW_COOKIE CookieName Value1 Value2 ...>

<?php if( ShowCookie("MyCookie","orange yellow") ) { ?>

  This is displayed if the cookie MyCookie contains 'orange' or 'yellow'.

<?php } ?>

ShowCookie( cookie, values )

<?php //----------------------------------------------------- // ShowCookie($cookie,$values) // - - - - - - - - // Returns true if the cookie $cookie contains any of // the values in $values. // // $values should be formatted: // "value1 value2 value3 ..." //----------------------------------------------------- function ShowCookie( $cookie, $values ) { if( !is_array($values) ) $values = explode(" ",trim($values)); while( $val = each($values) ) { $v = trim($val[value]); if( strlen($v) > 0 ) if( stristr($HTTP_COOKIE_VARS[$cookie], $v) ) return true; } return false; } ?>

<HIDE_COOKIE CookieName Value1 Value2 ...>

<?php if( HideCookie("MyCookie","blue") ) { ?>

  This is hidden if the cookie MyCookie contains 'blue'.

<?php } ?>

ShowCookie( cookie, values )

<?php //----------------------------------------------------- // HideCookie($cookie,$values) // - - - - - - - - // Returns false if the cookie $cookie contains any of // the values in $values. // // $values should be formatted: // "value1 value2 value3 ..." //----------------------------------------------------- function HideCookie( $cookie, $values ) { return !ShowCookie($cookie,$values); } ?>