Categories:
.NET (357)
C (330)
C++ (183)
CSS (84)
DBA (2)
General (7)
HTML (4)
Java (574)
JavaScript (106)
JSP (66)
Oracle (114)
Perl (46)
Perl (1)
PHP (1)
PL/SQL (1)
RSS (51)
Software QA (13)
SQL Server (1)
Windows (1)
XHTML (173)
Other Resources:
How To Receive a Cookie from the Browser
How To Receive a Cookie from the Browser? - PHP Script Tips - Understanding and Managing Cookies
✍: FYIcenter.com
If you know that a cookie has been sent to the browser when it was visiting the server previously, you can check the built-in $_COOKIE array, which contains all cookies that were sent by the server previously. The script below shows you how to pickup one cookie from the $_COOKIE and loop through all cookies in $_COOKIE:
<?php
if (isset($_COOKIE["LoginName"])) {
$loginName = $_COOKIE["LoginName"];
print("Received a cookie named as LoginName: ".$loginName."\n");
} else {
print("Did not received any cookie named as LoginName.\n");
}
print("All cookies received:\n");
foreach ($_COOKIE as $name => $value) {
print " $name = $value\n";
}
?>
2007-04-25, 4985👍, 0💬
Popular Posts:
Can Two Forms Be Nested? - XHTML 1.0 Tutorials - Understanding Forms and Input Fields Can two forms ...
What is the quickest sorting method to use? The answer depends on what you mean by quickest. For mos...
What is a fish bone diagram ? Dr. Kaoru Ishikawa, invented the fishbone diagram. Therefore, it can b...
What are unadjusted function points and how is it calculated? Unadjusted function points = ILF + EIF...
What are urlencode() and urldecode() functions in PHP? string urlencode(str) - Returns the URL encod...