You are here: Re: getting username « PHP Language « IT news, forums, messages
Re: getting username

Posted by Colin McKinnon on 10/30/31 11:25

ZeldorBlat wrote:

> getenv('USER');
>
> http://www.php.net/manual/en/function.getenv.php

Yeah, right.

Kleist wrote:

> I know that it rother not strict PHP question, but
> nevertheless, I'd like to know how to get username of the
> user who has run CLI php script via cron?

Might help if you told us what system this is on. If it's a Linux box you
could use:
$user=`id -un`;
or on most Unix boxes:
$user=`whoami`;

C.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация