Advertisement
Guest User

Untitled

a guest
Sep 15th, 2017
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. <?php
  2.  
  3. include("db.php");
  4. $user = 'user';
  5. $password = 'pwd';
  6.  
  7. $script = '/my/path/to/script/script.sh';
  8.  
  9. ...
  10.  
  11. $testResult = mysqli_query($dbConnection, $queryNextTest);
  12. $test = $testResult->fetch_object()->test_script; //this is my parameter obtained from query
  13.  
  14. $stream = ssh2_exec($connection, $script); //how can I use test as my paramter to execute the
  15.  
  16. ?>
  17.  
  18. $stream = ssh2_exec($connection, "/my/path/to/script/script.sh {$test}");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement