DA Plugin -> PHP Script Problem -> opening second .php
Hi hi
I've been working awhile now on a plugin for the DA panel. The plugin is installed correctly, and it has been coded with PHP.
The plugin is to to allow my users to manage the game servers I host for them. The script detects what kind of servers are installed by searching for their known strings. Then reads some config files and displays a few stats. This all works fine
The hard part now is allowing them to start/stop the servers. Now I pretty much had to learn PHP/borrow PHP code in order to do this thus far. So I am not entirely sure if this is a DA issue or a PHP issue. I am leaning towards DA though.
For each detected server, there are two links. One for starting, one for stopping. Since php is compiled server side and once it is sent to the browser, all the variables are lost. So the link leads to a new .php page that houses the script I need. This allows the script to run (its a shell_exec() script).
The problem:
The problem is, when the user clicks on the link to the new PHP file.. I get a page not found error. At first I thought it was permissions, so I gave the .php ugo=rwx to make sure. Still no go. And then I thought, well it seems like it is treating the link as a website address, and not a location to the file on the server.. so maybe I am just doing it wrong. I dont really know to be honest.
Originally, it would do:
ht tp://100.100.100.100:2222/home/testuser/testserver/start.php
..like that. the space was added (for this post only) to stop the path from turning into a link (which hides part of the path with '...'), the ip is fake of course, and the 2222 points to DA.
So then I tried using the full path 100.100.100.100/home/testuser/testserver/start.php without the 2222 port and retried again from DA. Same result.
So then I tried sticking the start.php in the plugins/user folder that the original index.html file was in. It does find the file now, but it says:
Unable to execute your request
Details
That plugin does not exist for the specified User Level
...which doesnt make sense either.. the file is chown'd to diradmin:diradmin . But then I am thinking.. I cant put this file there anyways, because I cant pass any variables to it so theres no way it will know which server it is suppose to run. (at this point all the start.php file has in it is just an echo saying "this file exists"). So the file is going to have to be put in the server's directory.. but then it cant be found.
So I am lost and confused and need help. What am I doing wrong?
echo "<b><a href=\"" . $startshell . "\" target=\"_blank\">[Start Server]</a> <a href=\"" . $stopshell . "\" target=\"_blank\">[Stop Server]<a></b><br><br>";
The above variables ($startshell) just have the generated pathname + the start.php added.
I havent tried using l0rdPhi1's PHP Class because I looked at it once and never understood it at all ...
Your help is really appreciated. I was wanting to have this all done by today. But it looks like I am going to have to push it until tuesday :\
Thanks again.. I am very grateful to you for contributing.
-Jeff
Hi hi

I've been working awhile now on a plugin for the DA panel. The plugin is installed correctly, and it has been coded with PHP.
The plugin is to to allow my users to manage the game servers I host for them. The script detects what kind of servers are installed by searching for their known strings. Then reads some config files and displays a few stats. This all works fine

The hard part now is allowing them to start/stop the servers. Now I pretty much had to learn PHP/borrow PHP code in order to do this thus far. So I am not entirely sure if this is a DA issue or a PHP issue. I am leaning towards DA though.
For each detected server, there are two links. One for starting, one for stopping. Since php is compiled server side and once it is sent to the browser, all the variables are lost. So the link leads to a new .php page that houses the script I need. This allows the script to run (its a shell_exec() script).
The problem:
The problem is, when the user clicks on the link to the new PHP file.. I get a page not found error. At first I thought it was permissions, so I gave the .php ugo=rwx to make sure. Still no go. And then I thought, well it seems like it is treating the link as a website address, and not a location to the file on the server.. so maybe I am just doing it wrong. I dont really know to be honest.
Originally, it would do:
ht tp://100.100.100.100:2222/home/testuser/testserver/start.php
..like that. the space was added (for this post only) to stop the path from turning into a link (which hides part of the path with '...'), the ip is fake of course, and the 2222 points to DA.
So then I tried using the full path 100.100.100.100/home/testuser/testserver/start.php without the 2222 port and retried again from DA. Same result.
So then I tried sticking the start.php in the plugins/user folder that the original index.html file was in. It does find the file now, but it says:
Unable to execute your request
Details
That plugin does not exist for the specified User Level
...which doesnt make sense either.. the file is chown'd to diradmin:diradmin . But then I am thinking.. I cant put this file there anyways, because I cant pass any variables to it so theres no way it will know which server it is suppose to run. (at this point all the start.php file has in it is just an echo saying "this file exists"). So the file is going to have to be put in the server's directory.. but then it cant be found.
So I am lost and confused and need help. What am I doing wrong?
echo "<b><a href=\"" . $startshell . "\" target=\"_blank\">[Start Server]</a> <a href=\"" . $stopshell . "\" target=\"_blank\">[Stop Server]<a></b><br><br>";
The above variables ($startshell) just have the generated pathname + the start.php added.
I havent tried using l0rdPhi1's PHP Class because I looked at it once and never understood it at all ...
Your help is really appreciated. I was wanting to have this all done by today. But it looks like I am going to have to push it until tuesday :\
Thanks again.. I am very grateful to you for contributing.
-Jeff
Last edited: