k, i'll try to explain this best as possible..
i don't know much about PHP, that would probly be a better alternitive than to this.
anyway, you will need cgi access (e.g. write access to /wherever/your/documentroot/is/cgi-bin)
in this example we will create a script in cgi-bin called 'mycommand'
Code:
#!/bin/sh
echo "executing stuff..."
exec /path/to/whatever
then on the webpage
Code:
<a href=http://yourwebsite.com/cgi-bin/mycommand>clicking here will execute your command</a>
this is a workaround, there is alot to cgi, but like i said you'd probly be better off using PHP