i used to use system commands through a php file ..cd \ was working then suddenly after a few tries it stopped 😐 no matter what i do
<?php
$command = array("cd \","dir");
$result = system($command[0], $return);
?>
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I think i figured out the problem..
the system() command in PHP does not create an instance of a cmd.exe
instead it only executes the command and exits.
that is why when you change directory using CD command
..the directory of the instance created by system() is changed and then exits.i hope my theory is correct xD