PHP Experts... need to know something.

Status
Not open for further replies.

Techwhore

Smack-Fu Master, in training
79
I'm trying to re-vamp the login/logout system at my workplace. Currently we login/out by sshing into a Solaris cluster and use a signin/out script to record entries.

What I want to do is implement a PHP web interface to do this with. The PHP script would need variables for username and password that it would use to somehow login into the UNIX cluster, then call upon the signin script and exit.

Is it possible to use PHP to login to a UNIX cluster like this? If so, how?
 

FriarPuck

Ars Praefectus
4,053
Subscriptor
code:<HR>
Code:
exec ("ssh -l root 92.168.0.1 ./signin",$array,$return_code);

exec() executes the given command. So, you could run ssh from your PHP script and have it run the signin script.

$array is (*gasp*)an array that holds every line of the output of the program you run.

$return_code holds return status of the executed command.
 
Status
Not open for further replies.