Press enter to see results or esc to cancel.


Run command prompt commands from PHP page


In this video I have shown how you can run command prompt commands from PHP page.

shell_exec(‘ ‘) can be used for executing cmd commands from php page.
The below image shows the ipconfig/all command executed from my pc.

We can run the same command from PHP page. The code is as below.


<?php

$out=shell_exec('ipconfig/all');

echo '<pre>'.$out.'</pre>';

?>

On running the above code in server, You can see the command prompt command has executed and the output has shown on the web page.


Comments

Comments are disabled for this post