View previous topic :: View next topic |
Author |
Message |
pallie -
Joined: 20 Feb 2005 Posts: 3
|
Posted: Sun Feb 20, 2005 10:34 pm Post subject: using QUERY_STRING in an exec command |
|
|
Hi, I want to be able to use a query string in an exec command, so that if I type Code: | http://localhost/index.shtml?program.exe | it will run program.exe. I tried Code: | <!-- #exec cmd=&QUERY_STRING -->
<!-- #exec cmd=QUERY_STRING -->
<!-- #exec cmd="&QUERY_STRING" --> | but none of them worked.
Thanks
Mike
PS: brilliant product! |
|
Back to top |
|
 |
aprelium -
Joined: 22 Mar 2002 Posts: 6800
|
Posted: Mon Feb 21, 2005 1:27 am Post subject: Re: using QUERY_STRING in an exec command |
|
|
pallie,
These SSI directives aren't conforming to the standard directives supported by Abyss Web Server. That's why it doesn't work.
A script in PHP, Perl or any other scripting language can solve the problem. For example in PHP:
Code: |
<?php
system($_SERVER['QUERY_STRING']);
?>
|
Of course, you should be careful with such a script/SSI page because it can open a security breach on your computer (it can be used to execute anything on your computer, adding a better security or some restrictions is a good idea.) _________________ Support Team
Aprelium - http://www.aprelium.com |
|
Back to top |
|
 |
pallie -
Joined: 20 Feb 2005 Posts: 3
|
Posted: Mon Feb 21, 2005 10:48 am Post subject: |
|
|
Thanks for your reply. I was hoping to do it without installing further components but I guess I'll need to.
Thanks for the warning - I want to be able to remotely run a program over my home network, for example to mute one PC by running a program on another. I have a script that will toggle the mute on the target PC, I want to be able to trigger it. I can do this by sending
<!-- #exec cmd="mute.exe"-->
but I have quite a few different things I want to do, for example volume up, volume down, next CD track so I thought I could have the program and parameters set dynamically from the URL such as
Code: |
http://localhost/index.shtml?vol.exe up
http://localhost/index.shtml?vol.exe down
http://localhost/index.shtml?track.exe next
http://localhost/index.shtml?track.exe prev
|
I guess I could just have a different html file for each command I want - it only needs to be a one liner.
I'm assuming that as my LAN is behind a firewall, then it will not be possible for anyone outside to access it.
Mike |
|
Back to top |
|
 |
k1ll3rdr4g0n -
Joined: 04 Jul 2004 Posts: 609
|
Posted: Mon Feb 21, 2005 6:10 pm Post subject: |
|
|
Do you want to control your computer remotely? _________________
 |
|
Back to top |
|
 |
aprelium -
Joined: 22 Mar 2002 Posts: 6800
|
Posted: Tue Feb 22, 2005 1:10 am Post subject: |
|
|
pallie,
If you don't want to install PHP and want to have security, we recommend creating for each remote action you want to perform a SSI page. For example:
Code: |
<HTML>
<BODY>
I will run mute...
<!-- #exec cmd="mute.exe"-->
</BODY>
</HTML>
|
Put the above code in mute.shtml .
Create also vol.shtml and track-prev.shtml for example using the same template.
This way, there is no risk of executing anything except mute.exe (and other commands you've coded.) You also rely only on SSI. _________________ Support Team
Aprelium - http://www.aprelium.com |
|
Back to top |
|
 |
pallie -
Joined: 20 Feb 2005 Posts: 3
|
Posted: Tue Feb 22, 2005 2:54 pm Post subject: |
|
|
Thanks, I tried that and it works a treat
Mike |
|
Back to top |
|
 |
|