Page 1 of 1
running an .exe in php
Posted: Tue Mar 31, 2009 4:18 pm
by stevelittrell
Hello All,
I have been working on my company intranet and would like to turn a field that is originally for a website into a field that you could enter an ip address and run vnc by clicking on the ip address that is entered. I am able to run the ip address through a command prompt using C:\Program Files\RealVNC\VNC4\vncviewer.exe xxx.xxx.xxx.xxx.
The Code that is currently in place is:
<?php if ( $this->contact->webpage && $this->params->get('show_webpage')) { ?>
<div id="contact-website" class="contact-other"><?php echo $mc . $this->params->get( 'marker_web' ); ?></div>
<a href="<?php echo $this->contact->webpage; ?>" target="_blank">
<?php echo $this->contact->webpage; ?></a></div>
<?php } ?>
<?php endif; ?>
Re: running an .exe in php
Posted: Tue Mar 31, 2009 6:04 pm
by Apollo
stevelittrell wrote:I am able to run the ip address through a command prompt using C:\Program Files\RealVNC\VNC4\vncviewer.exe xxx.xxx.xxx.xxx.
Exactly who is 'I', the webserver (which runs your php script) or the client (visitor who enters the IP) ?
Re: running an .exe in php
Posted: Tue Mar 31, 2009 10:05 pm
by stevelittrell
I am running this through a command prompt on the client. I basically want to run an executable that is located on the client. Reason why it is located in the same path on every workstation that is located in my network.
Thanks
Re: running an .exe in php
Posted: Wed Apr 01, 2009 2:50 am
by Mark Baker
If it's on the client, the answer is no; not with PHP.
I basically want to run an executable that is located on the client. Reason why it is located in the same path on every workstation that is located in my network.
Just consider the implications for the average hacker if it was possible.
Re: running an .exe in php
Posted: Wed Apr 01, 2009 8:16 am
by stevelittrell
This is for a company Intranet, which sits on an internal network and cannot be accessed from the outside world. I am not worried about hackers being able to access this because it sits behind our firewall and is only accessible to the users inside of our network.
Re: running an .exe in php
Posted: Wed Apr 01, 2009 8:25 am
by php_east
you would need some sort of browser plugin to execute the local executable file. javascipt and flash plugins do exactly that. you would need a DOS shell plugin, and i shudder to think when this pluign taken out from your intranet and installed in the internet, by accident or otherwise.
the other alternative is to use windows networking or some other networking protocol, which allows this kind of access. quite messy if you ask me, but if you can find a browsr shell pulgin, that would be marvelous, and hope you can share. i'm sure lots of good use can be put to it.
Re: running an .exe in php
Posted: Wed Apr 01, 2009 10:17 am
by Mark Baker
stevelittrell wrote:This is for a company Intranet, which sits on an internal network and cannot be accessed from the outside world. I am not worried about hackers being able to access this because it sits behind our firewall and is only accessible to the users inside of our network.
You might not be worried; but if PHP was capable of this, not everybody has the pleasure of running PHP only on a local intranet, and they would all be subject to nastiness.
But the point is moot, PHP on the server cannot access anything on the client directly. To do this, you'd need an application running on the client already that did have privilege to access the client filesystem.
Re: running an .exe in php
Posted: Thu Apr 02, 2009 8:27 am
by stevelittrell
Thank you to everyone for all of the help that you have given. I feel that I am making progress, I have created a batch file that would call the program:
C:\"Program Files"\RealVNC\VNC4\vncviewer.exe
EXIT
The code that I used in the webpage is the following:
<?php if ( $this->contact->webpage && $this->params->get('show_webpage')) { ?>
<div id="contact-website" class="contact-other"><?php echo $mc . $this->params->get(
'marker_web' ); ?></div>
<a href="vnc.bat"><?php echo $this->contact->webpage; ?></a></div>
<?php } ?>
<?php endif; ?>
This allows me to pull up the program and the parameters (i.e. the ip address) shows up on the webpage and allows me to click on it. I am now trying to find a way to pass the parameters to the program. Typically when you type in C:\"Program Files"\RealVNC\VNC4\vncviewer.exe xxx.xxx.xxx.xxx it will automatically input the ip address, but since I have multiple IP's I am curious to know if there is a way to echo what you are clicking on.