I used system commands through a php file ..cd \, and then suddenly after several attempts to stop it: | no matter what i do
<?php $command = array("cd \","dir"); $result = system($command[0], $return); ?>
I think I understood the problem. the system () command in PHP does not instantiate cmd.exe; instead, it only executes the command and exits. therefore, when you change the directory using the CD command .. the directory of the instance created by the system () is changed and then exits. I hope my theory is correct xD
Windows /, \, , , .
/
\
<?php $command = array("cd /","dir"); $result = system($command[0], $return); ?>
Wiki Path_Computing
- , , - , , .
$command = array("cd \\","dir");
linux mod:
mod:
$command = array("cd /","dir");
PHP : http://us3.php.net/manual/en/function.chdir.php. , .
( Win 7 XP) \ (.. \\ ). . , PHP chdir ?
\\
chdir
<?php echo getcwd() . "\n"; chdir("\\"); echo getcwd() . "\n"; ?>
"... cmd ...": . () , . , PHP-, , .
(), ?
<?php $result = system("cd \;".$command[0], $return);?>
Source: https://habr.com/ru/post/1777299/More articles:Deploying an application developed using C ++ - c ++Inner work more / less than - cjava date time compare two - javaIgnore branches in working copy of SVN - branchRegex для ввода формы описания - phpSearched question - c #How to install Google Map Api on a new Android device? - android')' Expected (java) - javaWhy is viewDidAppear in a UITabBarController executed before a view? - iphoneiPod: What does NS_NONATOMIC_IPHONEONLY mean? Can I use this feature on iPod Touch? - iphoneAll Articles