Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2019
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 KB | None | 0 0
  1. /var/www/test.sh 2015
  2.  
  3. /var/www/test.sh 2014
  4.  
  5. /var/www/output.jpg
  6.  
  7. root@rm:/var/www# cat test5.php
  8.  
  9. <html>
  10. <head><title>some title</title></head>
  11. <body>
  12. <form method="post" action="">
  13. <input type="text" name="something" value="<?= isset($_POST['something']) ? htmlspecialchars($_POST['something']) : '' ?>" />
  14. <input type="submit" name="submit" />
  15. </form>
  16.  
  17. <?php
  18. if(isset($_POST['submit'])) {
  19. echo ($_POST['something']);
  20. // Now the script should be executed with the selected year
  21. $message=shell_exec("/var/www/test.sh $something");
  22. // and after executing the script, this page should also open the output.jpg in the browser
  23.  
  24. }
  25. ?>
  26. </body>
  27. <html>
  28. root@rm:/var/www#
  29.  
  30. <form method="post" action="">
  31. <select name="something">
  32. <option value="2014">year 2014</option>
  33. <option value="2015">year 2015</option>
  34. </select>
  35. <input type="submit" name="submit" />
  36. </form>
  37.  
  38. $something = $_POST["something"];
  39. shell_exec("/var/www/test.sh $something");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement