News Feed
Jobs Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

SitePoint PHP Blog:
Interactive CLI password prompt in PHP
May 01, 2009 @ 09:34:38

On the SitePoint PHP blog today Troels Knak-Nielsen has a quick tip for those looking for a way to have their command-line PHP scripts be more interactive.

Just a quick tip, since I spent a good hour figuring this out recently. PHP has no native way of doing an interactive password prompt, when running as CLI. You can however use bash for the task.

His method (for both Windows and Unix systems) uses shell_exec command to run a VB Script/bash command that handles the password prompt for the PHP script. The result is then passed back into a variable and returned back to the calling application.

0 comments voice your opinion now!
interactive commandline password prompt windows unix vbscript bash


blog comments powered by Disqus

Similar Posts

Oracle Technology Network: Installing PHP and the Oracle Instant Client for Linux and Windows

PHP.net: PHP 5.2.9-2 (Windows) released

John Mertic's Blog: PHP 5.2.5 Windows Installer now working

Edin Kadribasic's Blog: PHP 4.4.3 for Windows with 5.0.22 MySQL libraries

PHP-GTK Community Site: PHP-GTK on Vista Memory Issue


Community Events











Don't see your event here?
Let us know!


language composer introduction series application security symfony2 framework hhvm facebook hack install component unittest example package code release opinion podcast

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework