1

(0 replies, posted in Programming)

hello i'm trying to authenticate with the server using the following function:


<?php
function nwauth ($nwserver, $user, $pass) {
  $command=sprintf("echo \"%s\" | /usr/local/surgemail/nwauth -S %s -U %s",  // parsing the
                    $pass, $nwserver, $user);          // command
    $out = array();                           // Just a dummy variable
    exec($command,$out,$err);                // *THE* meat!
    echo $err;
    print_r($out);
    if ($auth<>0){
      return 1; // failed authentication
    } else {
      return 0; // passed
    }
  }
?>

but always get the error 126.
there are another way?
anyone help me.
Thanks

2

(0 replies, posted in Programming)

GREETINGS.

I'm trying to execute a command in a remote server using:
<?php
exec ("rsh root@192.x.x.x command");
?>
unfortunately the remote server require a password.

how i send this parameter?
there are another php functión that allow execute comands in remote server?

Thanks for your help.