Hire a web Developer and Designer to upgrade and boost your online presence with cutting edge Technologies

Friday, October 21, 2022

Run command prompt commands from PHP page

 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.

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.

 

No comments:

Post a Comment