Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="ISO-8859-1">
- <title>Eval Main</title>
- </head>
- <body>
- <form action = "/cgi-bin/test.py" method = "post">
- <input id = "test1" type = "text" name = "a" />
- <input id = "ok" type = "submit" value = "Submit" />
- </form>
- <script type="text/javascript" src="scripts/jquery-1.10.2.js">
- $(document).ready(function(){
- $('#ok').click(function(){
- $.ajax({
- url:'https://192.168.80.27/cgi-bin/test.py',
- type:'post',
- dataType: 'Json',
- data: JSON.stringify({test1: document.getElementById('test').value}),
- success: function(data) {
- $('#name').val(data.output);
- }
- });
- });
- });
- </script>
- <div id="name"><div>
- </body>
- </html>
- #!/usr/local/bin/python3.6
- import cgi, cgitb
- import json
- from io import BytesIO
- from io import StringIO
- cgitb.enable()
- form = cgi.FieldStorage()
- url = form.getvalue('test1')
- print("Content-type: text/htmlrnrnn")
- print
- print(url)
Add Comment
Please, Sign In to add comment