Advertisement
metalx1000

Front End Very Basic httpd cgi-bin cmd runner

Jan 1st, 2015
409
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 0.92 KB | None | 0 0
  1. <html>
  2. <head>
  3.     <meta name="viewport" content="width=device-width, initial-scale=1">
  4.     <script src="../js/jquery.js"></script>
  5.     <script>
  6.         $(document).ready(function(){
  7.             $("#run").click(function(){
  8.                 var url="../cgi-bin/cmd.cgi";
  9.                 var cmd=$("#input").val();
  10.                 $.get(url,{cmd:cmd}).done(function(data){
  11.                     $("#output").append("<pre>"+data+"</pre>");
  12.                 });
  13.             });
  14.  
  15.                         $("#open").click(function(){
  16.                                 var url="../cgi-bin/cmd.cgi";
  17.                                 var cmd=$("#input").val();
  18.                 window.open(url+"?cmd="+cmd, 'output');
  19.                         });
  20.  
  21.         });
  22.     </script>
  23. </head>
  24. <body>
  25.     <input type="text" id="input" style="font-size: 40px;width:100%">
  26.     <br>
  27.     <button id="run" style="font-size: 40px;width:50%">Run</button>
  28.     <button id="open" style="font-size: 40px;width:50%">Open</button>
  29.     <hr>
  30.     <div id="output"></div>
  31.  
  32. </body>
  33. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement