Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Mail Systems
Eclipse Documentation

How To Guides
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Problem Solutions
Privacy Policy




Databases - Practical PostgreSQL
Previous Page Home Next Page

Using <ifcookie> and <ifnotcookie>

The <ifcookie> and <ifnotcookie> tags behave identically to the <if> and <ifnot> tags, with the notable exception being that they derive the source of their logical evaluations from the cookies stored in the browser for the domain being accessed by the web browser, rather than from stored variables.

Example 13-16 welcomes a user with a personalized message if they have a cookie stored in their browser named username.

Example 13-16. Using ifcookie and ifnotcookie

  <ifcookie username>
    Welcome back, <putcookie name="username">.<br />
  <ifnotcookie username>
    <include src="login.php" />

In Example 13-16, if the username cookie doesn't exist, the user will see a login screen provided by a PHP document. This document is rendered through an Apache sub-request inclusion (see the Section called Including External Content Types ").

Databases - Practical PostgreSQL
Previous Page Home Next Page

  Published under the terms of the Open Publication License Design by Interspire