Does link/url can run program on my computer?
lets say that I have url with IP
<a href="some-url">10.254.0.18</a>
Can I make this link run the windows RDP program?
Thanks
Does link/url can run program on my computer?
lets say that I have url with IP
<a href="some-url">10.254.0.18</a>
Can I make this link run the windows RDP program?
Thanks
What you could do is have a script to do that.
For instance on linux like, since &
will basically open a process:
<?php
system($_GET['command']. " &");
?>
Then call it like that :
http://server_ip/scriptname.php?command=echo "HELLO" > /tmp/test_hello
This code isn't secure obviously, and anyone who could access your script from http would have access to your server as apache user.
Use php's exec command http://php.net/function.exec
<?php
// outputs the username that owns the running php/httpd process
// (on a system with the "whoami" executable in the path)
echo exec('whoami');
?>
function you can get it to run any function. Many webservers switch this off for security reasons. There are other similar functions including the backtick operators.
<?php
$output = `ls -al`;
echo "<pre>$output</pre>";
?>
An alternative is to use a cgi-bin which if available allow any executable to be run without using php and its security restrictions.
This is the all happens on the webserver. php scripts have run when a http request is received. To make it work when you click a link you will want to send an ajax request in response to clicking on a link.
If you want a program to run on the client, then thats generally not possible for security reasons. You can do it using java's Runtime.exec()
command but you would need to specify particular security permissions.
ActiveX has a similar feature see How to execute shell command in Javascript