iSelfSchooling.com - Copyright © 1999-2007 iSelfSchooling.com  References  Job Openings  |  Secure Login
    Home  | Search more...  |  FREE Online VIDEO Oracle Training  |  Gift Store  |  Bookstore

   Unlimited access!   

    Oracle  Syntax  | Suggestions Your Contribution  |  FREE Legal Forms

 

Email2aFriend Homepage us! |  Bookmark   -  Copyright & User Agreement

Products/Services

 Vision/Mission

 Community Sharing

 Services

  Products

 Biography

 Contact Us

 FAQ

 Current News

 Website Traffic

 Bookstore

 FREE Training

 SQL

 PL/SQL

 Forms 

 Reports

 Other TOOLS

 Fundamentals

 Performance

 OEM

 Application Server

 Grid Control

 Articles

 Prepare for OCP

Oracle SYNTAX

 Oracle Functions

 Oracle Syntax

 Oracle 10g Syntax

  PL/SQL Syntax

UNIX and more...

 UNIX for DBAs

 LINUX for DBAs

 DB using PHP

  A+ Certification

 Basics of JAVA  

 Tips of  SEO

Finance/Jobs

 Financial Aid

 Skilled

 Oracle

 Jobs

  Magazine

More Training

 Q & Answers

 SQL-PL/SQL

 DBA

 Developer

 Important Notes

 Case Studies

 9i New Features

 10g New Features

 10g Qs/As

 Grid Control

 OracleAS # I

 OracleAS # II

  LDAP and OID

  HTTP Server

 Instructor-Led

  Virtual Hosts

 Community Sharing

More to know...

Acknowledgement**

 FREE Legal Forms

 Who is who

 Market Place

 University Directory

 Advisory Articles

 Links...

 

 

How to read from cookies in PHP?

More Resources by Google:

How to read from cookies in PHP?


You read cookies’ value the same as you have been reading POST store method. The following is the format: $_COOKIE[‘name’]; Remember that the cookies’values are accessible to all scripts in your application except the one that sent it.

setcookie (‘name’, ‘Borna and Dana’);
print $_COOKIE[‘name’]; 

The value on print will be null.

Now, let us write a PHP to view all user’s information. Type the following code into notepad and save it as “view_cookies.php” then upload it to your web server.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitionl.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
<title>View user information from cookies</title>
</head>

<body>

<?php 
// always have your error handling turn on.
ini_set (‘display_errors’,1); 
error_reporting (E_ALL & ~E_NOTICE);

// check for user information
if (isset ($_COOKIE[‘name’])) {
print “Name: {$_COOKIE[‘name’]};\n”
}
if (isset ($_COOKIE[‘ssn’])) {
print “Social Security Number: {$_COOKIE[‘ssn’]};\n”
}
if (isset ($_COOKIE[‘phone’])) {
print “Phone: {$_COOKIE[‘phone’]};\n”
}
if (isset ($_COOKIE[‘email’])) {
print “email address: {$_COOKIE[‘email’]};\n”
}

?>
</body>
</html>

 

 

 
 
Google
 
Web web site