using exec() function

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
psmshankar
Forum Commoner
Posts: 96
Joined: Tue Aug 06, 2002 4:25 am
Location: India

using exec() function

Post by psmshankar »

Hi

when i run the following code my system either too slow and nothing coming up in the browser(expect the progress bar moving slowly at the bottom) or my system gets restarted abrubtly..
i donno whats wrong..i am just trying a sample to open up a notepad...

Code: Select all

$sCommand = "c:/windows/notepad.exe";
exec($sCommand);
i tried using "c:\windows\notepad.exe" as well as just "notepad" but nothing seems to work..
any idea where i am wrong..
i am using win/php 4/apache 1.3

Shankar
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

notepad is a gui program that doesn't stop until it is closed. What are you trying to achieve?
psmshankar
Forum Commoner
Posts: 96
Joined: Tue Aug 06, 2002 4:25 am
Location: India

Post by psmshankar »

actually i wrote a script to dump mysql data..

Code: Select all

$sPath = "c:\phpdev3\mysql3.23\bin";
$sCommand=$sPath. "\mysqldump -h".$sServerName." - u".$sUsername." -p".$sPassword." ".$dbname." > ".$DIRNAME.$dbname.".sql";
it did not produce any result and exactly same situation which i explained first...
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

print $sCommand and enter the output in a dos-box. Does that work?
At least " - u " contains a space too much.
Post Reply