$my_session_id = 0; $server_cookie_name = 'php_tst'; // -- php functions -- // --------------------------------------------------------------------- function init_headers() { // stop all caching // date in the past //header("Expires: -1"); // always modified //header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); // HTTP/1.1 //header("Cache-Control: no-store, no-cache, must-revalidate"); //header("Cache-Control: post-check=0, pre-check=0", false); // HTTP/1.0 //header("Pragma: no-cache"); // IE 6 fix //header("Cache-control: private"); // from comp.lang.php header('Cache-Control: no-cache, no-store'); header('Pragma: no-cache'); //jdw: header("P3P: CP=\"CAO DSP COR CURa ADMa DEVa OUR IND PHY ONL UNI COM NAV INT DEM PRE\""); // ---- } // --------------------------------------------------------------------- function html_reload($link) { header("Location: {$link}"); exit(0); echo "\n"; echo "
\n"; echo " \n"; echo "\n"; echo "\n"; } // --------------------------------------------------------------------- function stripslashes_deep($value) { $value = is_array($value) ? array_map('stripslashes_deep', $value) : stripslashes($value); return($value); } // --------------------------------------------------------------------- function my_session() { global $my_session_id; global $server_cookie_name; // -- get/set session name from cookie -- $my_session_id = $_COOKIE[$server_cookie_name]; if (!isset($my_session_id)) { $new_session_id = strval(mt_rand()) . strval(time()); $new_session_id = md5($new_session_id); // $new_session_expire = time() + (60 * 10); $new_session_expire = 0; setcookie($server_cookie_name, $new_session_id, $new_session_expire, '/'); } // -- get session data -- if (isset($my_session_id)) { if (!session_id()) { session_id($my_session_id); } session_start(); if (!isset($_SESSION['password'])) { $_SESSION['password'] = ''; } } } // --------------------------------------------------------------------- function save_post_data() { // create variable string $var_str = ""; $var_str .= "\$post_data = "; $var_str .= var_export($_POST, true); $var_str .= ";"; $_SESSION['post_data_str'] = $var_str; } // --------------------------------------------------------------------- ?>