Guest User

Untitled

a guest
Jan 11th, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="ISO-8859-1">
  5. <title>Eval Main</title>
  6. </head>
  7. <body>
  8.  
  9.  
  10. <form action = "/cgi-bin/test.py" method = "post">
  11. <input id = "test1" type = "text" name = "a" />
  12. <input id = "ok" type = "submit" value = "Submit" />
  13. </form>
  14.  
  15. <script type="text/javascript" src="scripts/jquery-1.10.2.js">
  16. $(document).ready(function(){
  17. $('#ok').click(function(){
  18. $.ajax({
  19. url:'https://192.168.80.27/cgi-bin/test.py',
  20. type:'post',
  21. dataType: 'Json',
  22. data: JSON.stringify({test1: document.getElementById('test').value}),
  23. success: function(data) {
  24. $('#name').val(data.output);
  25. }
  26. });
  27. });
  28. });
  29. </script>
  30.  
  31. <div id="name"><div>
  32. </body>
  33. </html>
  34.  
  35. #!/usr/local/bin/python3.6
  36.  
  37. import cgi, cgitb
  38. import json
  39. from io import BytesIO
  40. from io import StringIO
  41.  
  42. cgitb.enable()
  43. form = cgi.FieldStorage()
  44. url = form.getvalue('test1')
  45.  
  46. print("Content-type: text/htmlrnrnn")
  47. print
  48.  
  49. print(url)
Add Comment
Please, Sign In to add comment