manual/en/features.cookies.php

ARCHIVED 2003-08-05, DATE APPROXIMATE · VERSION 20030805_rev01 · COMPARED WITH 20030618_rev01

Full text changes — 20030618_rev01 to 20030805_rev01

COLOUR MARKS THE SEVERITY OF A FLAGGED CLAUSE · + AND − MARK ADDED AND REMOVED

55Any cookies sent to you from the client will automatically be turned into a PHP variable just like GET and POST method data, depending on the register\_globals and variables\_order configuration variables. If you wish to assign multiple values to a single cookie, just add _\[\]_ to the cookie name.
66
77In PHP 4.1.0 and later, the $\_COOKIE auto-global array will always be set with any cookies sent from the client. $HTTP\_COOKIE\_VARS is also set in earlier versions of PHP when the track\_vars configuration variable is set.
88
99For more details, including notes on browser bugs, see the [**setcookie()**](http://www.php.net/manual/en/function.setcookie.php) function.
1010
11<table><tbody><tr><td><small>User Contributed Notes</small><br><b>Cookies</b></td><td><a href="http://www.php.net/manual/add-note.php?sect=features.cookies&amp;redirect=http://www.php.net/manual/en/features.cookies.php"><img src="http://static.php.net/www.php.net/images/notes-add.gif" alt="add a note" width="13" height="13"></a> <small><a href="http://www.php.net/manual/add-note.php?sect=features.cookies&amp;redirect=http://www.php.net/manual/en/features.cookies.php">add a note</a></small></td></tr><tr><td colspan="2">There are no user contributed notes for this page.</td></tr></tbody></table>
11<table><tbody><tr><td><small>User Contributed Notes</small><br><b>Cookies</b></td><td><a href="http://www.php.net/manual/add-note.php?sect=features.cookies&amp;redirect=http://www.php.net/manual/en/features.cookies.php"><img src="http://static.php.net/www.php.net/images/notes-add.gif" alt="add a note" width="13" height="13"></a> <small><a href="http://www.php.net/manual/add-note.php?sect=features.cookies&amp;redirect=http://www.php.net/manual/en/features.cookies.php">add a note</a></small></td></tr><tr><td colspan="2"><a name="#34157"></a><table><tbody><tr><td><b>wilton at intertranet dot com</b><br>17-Jul-2003 05:14</td><td><br></td></tr><tr><td colspan="2"><code>if ((isset($aid)) &amp;&amp; (isset($pwd)) &amp;&amp; ($op == "login")) {<br>&nbsp; &nbsp;if($aid!="" AND $pwd!="") {<br>$pwd = md5($pwd);<br>$result=sql_query("select pwd, admlanguage from ".$prefix."_authors where aid='$aid'", $dbi);<br>list($pass, $admlanguage)=sql_fetch_row($result, $dbi);<br>if($pass == $pwd) {<br>&nbsp; &nbsp;$admin = base64_encode("$aid:$pwd:$admlanguage");<br>&nbsp; setcookie("admin","$admin",time()+3600);<br>&nbsp; unset($op);<br>}<br>&nbsp; &nbsp;}<br>}<p>$admintest = 0;</p><p>if(isset($admin) &amp;&amp; $admin != "") {<br>$admin = base64_decode($admin);<br>&nbsp;$admin = explode(":", $admin);<br>&nbsp;$aid = "$admin[0]";<br>&nbsp;$pwd = "$admin[1]";<br>&nbsp;$admlanguage = "$admin[2]";<br>&nbsp;if ($aid=="" || $pwd=="") {<br>&nbsp; &nbsp;$admintest=0;<br>&nbsp; echo "&lt;html&gt;\n";<br>&nbsp; &nbsp;echo "&lt;title&gt;Ingreso prohibido&lt;/title&gt;\n";<br>&nbsp; &nbsp;echo "&lt;body bgcolor=\"#FFFFFF\" text=\"#000000\"&gt;\n\n</p><p>\n\n";<br>&nbsp; &nbsp;echo "&lt;center&gt;&lt;img src=\"images/logo.gif\" border=\"0\"&gt;</p><p>\n";<br>&nbsp; &nbsp;echo "&lt;font face=\"Verdana\" size=\"+4\"&gt;&lt;b&gt;Su Ip esta siendo registrada en nuestra base de datos, toda operaci�n indebida ser� investigada.</p><p>Gerencia Administrativa&lt;/b&gt;&lt;/font&gt;&lt;/center&gt;\n";<br>&nbsp; &nbsp;echo "&lt;/body&gt;\n";<br>&nbsp; &nbsp;echo "&lt;/html&gt;\n";</p></code><br></td></tr></tbody></table></td></tr><tr><td colspan="2"><a href="http://www.php.net/manual/add-note.php?sect=features.cookies&amp;redirect=http://www.php.net/manual/en/features.cookies.php"><img src="http://static.php.net/www.php.net/images/notes-add.gif" alt="add a note" width="13" height="13"></a> <small><a href="http://www.php.net/manual/add-note.php?sect=features.cookies&amp;redirect=http://www.php.net/manual/en/features.cookies.php">add a note</a></small></td></tr></tbody></table>