PhpDig.net

What is PhpDig?
PhpDig is a PHP MySQL based
Web Spider & Search Engine.




apache_note

Name

apache_note — Gets or sets Apache note entries.

Synopsis

mixed apache_note(key[, value]);
string key: Name of the note entry
string value (optional): Value of the note entry

Returns

Value of the Apache note corresponding to the key specified as the first argument, or FALSE if no entry was found for the specified key

Description

Apache maintains an internal notes table - a simple list of key/value pairs - for every request; with this function, you can get and set entries from this table. The notes table will be flushed as soon as the request has been processed.

To set a new notes entry, specify its name as the first argument and its value as the second. If you leave out the second argument, the function returns the contents of the notes entry corresponding to the non-case-sensitive key specified as the first argument. If no matching entry is found, the function returns FALSE. Note that if you set an entry, the function returns the value of the old entry, if one was found, or FALSE otherwise.

apache_note() is helpful in passing information between modules that operate at different stages of the request. For example, it could be used for logging: You could create an Apache note entry listing the currently logged-in user and include the username in the server logs using mod_log_config with a custom directive such as "%{username}n".

Warning

In versions prior to 3.0.3, apache_note() corrupted memory and produced segfaults in some circumstances.

Version

Existing since version 3.0.2

Example

Example 2. Set an Apache notes entry listing the currently logged-in user

apache_note("username", $PHP_REMOTE_USER);



PHP Functions Essential Reference. Copyright © 2002 by New Riders Publishing (Authors: Zak Greant, Graeme Merrall, Torben Wilson, Brett Michlitsch). This material may be distributed only subject to the terms and conditions set forth in the Open Publication License, v1.0 or later (the latest version is presently available at http://www.opencontent.org/openpub/). The authors of this book have elected not to choose any options under the OPL. This online book was obtained from http://www.fooassociates.com/phpfer/ and is designed to provide information about the PHP programming language, focusing on PHP version 4.0.4 for the most part. The information is provided on an as-is basis, and no warranty or fitness is implied. All persons and entities shall have neither liability nor responsibility to any person or entity with respect to any loss or damage arising from the information contained in this book.

Powered by: vBulletin Version 3.0.7
Copyright ©2000 - 2005, Jelsoft Enterprises Ltd.
Copyright © 2001 - 2005, ThinkDing LLC. All Rights Reserved.