/[gentoo-src]/glep15/cookie.php
Gentoo

Contents of /glep15/cookie.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Fri Nov 21 17:17:01 2003 UTC (10 years, 11 months ago) by hythloday
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +14 -5 lines
Couple of syntax changes to allow pages to run.

1 <?php
2 /***************************************************************************
3 * cookie.php
4 *
5 * Sat Oct 18 14:45:41 2003
6 * Copyright 2003 lisa seelye
7 * Copyright 2003 Gentoo Technologies, Inc.
8 * lisa@gentoo.org - www.gentoo.org
9 *
10 * $Header: /home/cvsroot/gentoo-src/glep15/cookie.php,v 1.1 2003/10/30 21:52:52 lisa Exp $
11 ***************************************************************************
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or
15 * (at your option) any later version.
16 *
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU Library General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
25 **************************************************************************/
26
27 /* This file stores the functions to interact with Cookies (set & get functions) */
28 ob_start();
29
30 function getCookie($key) {
31 return $_COOKIE["$key"];
32 }
33
34 function cookie($key, $value, $domain, $expire = 0, $path = "", $secure = 0) {
35 /* Sets a cookie value $value with key $key, default to expire when the browser exits,
36 * for all of the domain.
37 */
38 if (is_null($path)) {
39 $path = dirname($_SERVER['PHP_SELF']);
40 }
41 if (is_null($domain)) {
42 $domain = $_SERVER['SERVER_NAME'];
43 }
44 return setcookie($key,$value,$expire,$path,$domain,$secure);
45 }
46 ?>

  ViewVC Help
Powered by ViewVC 1.1.20