PhpDig.net

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




get_current_user

Name

get_current_user — Determines the owner of a PHP script.

Synopsis

string get_current_user(void)

Returns

Owner of script file

Description

Returns the owner of the file containing the script, not the username of the process executing the script. For instance, while one user may own the script, the name of the user executing the script may be the web server. Depending on the platform that PHP is running on, this can have an effect if attempting to perform such tasks as file system access.

get_current_user() can also be used to provide a small measure of system security. By comparing the owner of the script to the owner of a file, Trojan horse type exploits can be partially minimized. This is useful only on systems with a concept of multiple users and permissions, such as UNIX-based systems.

Example

Example 995. Display owner of the current script

<?php
echo get_current_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.