"); print("You have been logged out. Return home."); include("footer.php"); */ session_start(); $user = $_SESSION['user']; if ($user) { if (!function_exists('getDomain')) { function getDomain() { if ( isset($_SERVER['HTTP_HOST']) ) { // Get domain $dom = $_SERVER['HTTP_HOST']; // Strip www from the domain if (strtolower(substr($dom, 0, 4)) == 'www.') { $dom = substr($dom, 4); } // Check if a port is used, and if it is, strip that info $uses_port = strpos($dom, ':'); if ($uses_port) { $dom = substr($dom, 0, $uses_port); } // Add period to Domain (to work with or without www and on subdomains) $dom = '.' . $dom; } else { $dom = false; } return $dom; } } $domain = getDomain(); // Set expiration (30 days) $expire = time() - (86400*800); // Set the cookie setcookie('pileof_name', "", $expire, '/', "pileofphotos.com"); setcookie('pileof_name', "", $expire, '/', "www.pileofphotos.com"); unset($_COOKIE["pileof_name"]); } unset($_SESSION['user']); $_SESSION['user'] = ''; session_destroy(); /*include("header.php"); print ("



"); print("You have been logged out. Return home."); include("footer.php"); */ header("location: index.php"); ?>