LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Execute file from webpage (https://www.linuxquestions.org/questions/programming-9/execute-file-from-webpage-159454/)

jeucken 03-18-2004 12:07 PM

Execute file from webpage
 
Hi,
I'm trying to find out how I can execute a file by clicking on a button on my website.

I have a simple PHP test site running on my webserver. Now I would like to create a button on it that, when you press it, executes a file on the server itself. (Like a script, or for example a Half-Life server)

Does anyone have any experience with this?

david_ross 03-18-2004 12:58 PM

Take a look at php exec:
http://www.php.net/exec

Moved to programming

naflan 03-18-2004 02:05 PM

<?php

exec("command");

>

to view output of command:

exec("command 2>&1",$output);
while(list(,$val)=each($output)) :
print("$val<br>");
endwhile;


All times are GMT -5. The time now is 10:43 AM.