Jump to content

Recommended Posts

hi all what i want to do is to be able to launch command prompt from a php link and use data from the link to ping an address

 

so example i click ping(url ping.php?IP=1.1.1.1) this computer command prompt is launched and it pings the the ip cotained in the link, is this possible?

 

i want to launch VNC and RDP from links to if that is possible?

 

THanks

Okay, your getting a bit beyond the scope of PHP here ...

 

You can, through the use of exec() and system() ... run or execute command line tools like ping however.  You can even have it open up a command window/terminal.

 

I think for what your trying to do though, it would be best to make a batch file, then execute the batch file from PHP.

You may try:

 

<?php

exec('c:\windows\system32\cmd.exe');

?>

 

But that may not do anything.  PHP isn't really designed to run interactively ... Even so, what is the purpose of just opening the command window?  It would better serve you if you just executed the actual command utility that you want.

Just in case you are unaware I'm letting you know.

 

using exec() or system() will run on the server not the client. If you want to see a terminal interface that you can use to enter commands to execute on the server your way is just not gonna cut it.

 

As for the OS mattering. It matters wether the OS of the server is linux, unix windows or whatever OS is out there that runs PHP. For example using exec() on a windows OS  means you can run .exe files or .bat files. On a linux server those two wont work.

ah right thanks for that info

 

i wanted it to run client side, so i guess thats out the window

 

i think ill just drop the idea and type in the IP for RDP or VNC then, just thought i could save myself 0.5 seconds by not typing lol

 

Thanks though

If your looking for a way to make your server-side app invoke local, client-side commands on a users computer then it won't work 'out-of-the-box', Nor would you want it to.

 

Imagine an internet where web developers could have web sites 'activate' tools on your OS just cause you viewed their web site.

 

What you want to do is possible though through things like Java Applets and ActiveX Objects, both of which require a conscious client authorization and installation.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.