You are here: Re: Using Exec Function « PHP « IT news, forums, messages
Re: Using Exec Function

Posted by Jason Barnett on 06/16/05 17:52

Exec is the way to go... it gives you output as well as any error
status. Here's an example script that works for a Win32 program I have
and you should be able to adapt to your own usage:

<?php
/** Notice that the command has extra quotes around it for the Windows
command line as well as double-backslashes for each directory in the path */
$win_cmd = "\"C:\\Program Files\\The Regex Coach\\The Regex Coach.exe\"";
exec($win_cmd, $stdout, $stderr);
print "Standard output:\n";
print_r($stdout);
print "Standard error:\n";
print_r($stderr);

?>

--
NEW? | http://www.catb.org/~esr/faqs/smart-questions.html
STFA | http://marc.theaimsgroup.com/?l=php-general&w=2
STFM | http://php.net/manual/en/index.php
STFW | http://www.google.com/search?q=php

 

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

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