note 35649 added to function.system

From: Date: Tue, 09 Sep 2003 21:24:08 +0000
Subject: note 35649 added to function.system
Groups: php.notes 
Request: Send a blank email to php-notes+get-55902@lists.php.net to get a copy of this message
Re: cpmorris at hotmail dot com and WINNT. I just spent some time learning to use the php system function. I managed to get long file names to work for me. It seems you need to take the same approach that batch files, WSH, and most other programming languages do under WinNT/2K/XP. Putting double quotes around the Path+Filename seems to work. So, something like this should have worked for you: "c:\program files\apache group\apache2\bin\htpasswd" Note that if you have parameters, they go OUTSIDE of the last quote. Oh, and don't forget to escape the slashes and quotes! I don't know what htpasswd's params are, but let us pretend: $cmd="\"c:\\program files\\apache group\\apache2\\bin\\htpasswd\" username password"; $str=system($cmd); Hope this helps someone! Leonard http:\\www.lc.yi.org ---- Manual Page -- http://www.php.net/manual/en/function.system.php Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+35649 Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+35649&report=yes Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+35649&report=yes

« previous php.notes (#55902) next »