Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /var/www/test.sh 2015
- /var/www/test.sh 2014
- /var/www/output.jpg
- root@rm:/var/www# cat test5.php
- <html>
- <head><title>some title</title></head>
- <body>
- <form method="post" action="">
- <input type="text" name="something" value="<?= isset($_POST['something']) ? htmlspecialchars($_POST['something']) : '' ?>" />
- <input type="submit" name="submit" />
- </form>
- <?php
- if(isset($_POST['submit'])) {
- echo ($_POST['something']);
- // Now the script should be executed with the selected year
- $message=shell_exec("/var/www/test.sh $something");
- // and after executing the script, this page should also open the output.jpg in the browser
- }
- ?>
- </body>
- <html>
- root@rm:/var/www#
- <form method="post" action="">
- <select name="something">
- <option value="2014">year 2014</option>
- <option value="2015">year 2015</option>
- </select>
- <input type="submit" name="submit" />
- </form>
- $something = $_POST["something"];
- shell_exec("/var/www/test.sh $something");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement