|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
looking to create a web-based control panel
hi i am looking to create a webbased control panel.
What i want to do is have a central location where a person can login. With that authentication, they can have a choice of start/stop a service on a remote machine. the remote machine can be either windows or linux. i am trying to find a way for that service to react with a mouse click. Am i looking at the wrong direction trying to program with php? any help would be great |
|
#2
|
|||
|
|||
|
I don't see any reason not to do this but you probably won't be able to do the whole thing in php. More likely you can write the control panel in php but it'll have to talk to a c/c++ (or similar) app that actually deals with the service, especially if it is one on another machine to the webserver.
-KM- |
|
#3
|
||||
|
||||
|
Yeah, looks like this is one of the few cases where old-fashioned C++ CGI may actually be of more use than PHP...
![]() |
|
#4
|
|||
|
|||
|
I don't know about that, I'd still write the bulk of it in php and have it talk to the other machine via a socket connection allowing it to issue instructions to the c/c++ app which can then act accordingly.
-KM- |
|
#5
|
||||
|
||||
|
Yeah, but that's because you're a PHP programmer :-D.
In situations like this, actual C++ CGI is faster and more secure. It's also the method most web-based admin tools for webservers use, as far as I know. |
|
#6
|
|||
|
|||
|
Actually I have a similar amount of c/c++ experience as i do php experience. My main reason for this is speed of development since I doubt the speed of execution difference will be great enough to make a difference in 99% of cases. Also I contest that it will be more secure since php is buffer overflow free but c/c++ apps are not. What were you basing that one on out of interest?
-KM- |
|
#7
|
||||
|
||||
|
Agree with you on the development speed, that's definately the big advantage of PHP over others.
Performance is not noticable on newer servers, but used to be an issue. Interpreted languages are slower, that's a fact, only with modern equipment we don't notice it anymore, so it's no longer a reason to stick to C++. As for security, I meant the fact that PHP will execute till it encounters an error, while C++ doesn't even compile with errors (runtime errors do not exist in compiler languages). This means you don't have the risk of a half-executing program screwing up your system when it doesn't change all it is supposed to change. I encountered this once when an edit program did delete the old entry, but failed to create the new one due to an error. As for buffer overflows, this is an encreased risk, that's true, but also more controllable, a good programmer checks for these. |
|
#8
|
|||
|
|||
|
'runtime errors do not exist in compiler languages'
I'm not quite sure what you mean by this but runtime errors do exist in compiled languages and have just as much chance of screwing up a system. Go try to divide something by zero for example. It'll compile but it won't run. -KM- |
|
#9
|
||||
|
||||
|
You're right, i used the wrong term. What I meant is that in PHP, most errors, except parser errors, are not given until the code in question is executed. In C, all code is checked during compilation, even code that's in a loop that never gets executed (like in an if(1 == 2) for example).
|
|
#10
|
|||
|
|||
|
The compiler can only check the syntax and semantics of the code (which the php parser will do for you as well and issue warnings/errors when you try to run it for the first time). No compiler can check the logic of your program for you.
-KM- |
|
#11
|
||||
|
||||
|
Quote:
If it could, we'd be out of a job ![]() |
![]() |
| Viewing: Dev Articles Community Forums > Programming > PHP Development > looking to create a web-based control panel |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|