Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

run commands from operating system

Status
Not open for further replies.

AnakinPt

Programmer
Mar 29, 2001
583
PT
Hi

I have a problem. I have a XP home with Apache 1.X and PHP.

I need to execute command prompt commands using something like this:

$data = `dir`;

This should only be used in one special folder, and only in one of my virtual hosts.

Thanks in advance

Anikin
Hugo Alexandre Dias
Web-Programmer
anikin@anikin-skywalker.com
 
I am not sure what the problem is. Write a CGI that executes this command in that folder and you should be set??

Maybe you can be more clear in what problem you are having doing this operation.
 
You should use the PHP command "EXEC"

exec("dir c:");

echo "script completed";

exec returns a string so you should be able to do

$var = exec("dir");
echo $var;

Hope this help!

Sincerely,

Dan Grant
Lead programmer
dan at abusinesshosting dot com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top