<? if(isset($HTTP_COOKIE_VARS["TestCookie"])) {// Check if TestCookie is set $cookieset = "set";
// Read the Cookie $cookieid = $HTTP_COOKIE_VARS["TestCookie"]; // and increase its value $cookieid++; } else { // cookie was not set $cookieset = "not set"; // start counter at zero $cookieid = 0; } // apply the Cookie to the HTTP header setcookie("TestCookie",$cookieid); // set the content type for WML header("Content-type: text/vnd.wap.wml");
// disable ALL caching header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); header("Cache-Control: no-cache, must-revalidate"); header("Pragma: no-cache"); echo("<?xml version=\"1.0\"?>\n"); echo("<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\" \"http://www.wapforum.org/DTD/wml_1.1.xml\">\n\n"); echo("<!-- This application attempts to test the capabilities of a WAP gateway to support cookie s -->\n"); echo("<!-- App by Espen.Lyngaas@colorline.no (c) 2000 -->\n"); // Generate random value for reload forcing $random = mt_rand(100000,999999); ?> <wml> <head>