In-depth research form Submit: getpost

xiaoxiao2021-03-06  79

In-depth research form Submission method: GET / Post Hackfan This article: Windows 2000 Professional Apache 1.3.17 Perl 5.6.1 Internet Explorer 5.00.2920.0000 Do you know that there are GET and POST in the future. I am here to say something here, give you a request for a form submitted by GET: Get /cgi-bin/tech/Method.cgi?get=get http / 1.1accept: image / gif, image / x-xbitmap , Image / JPEG, Image / Pjpeg, Application / VND.ms-PowerPoint, Application / VND.ms-Excel, Application / Msword, * / * Referr: http://localhost//other.htmlaccept-language: en-cnaccept -Encoding: Gzip, DeflateUser-agent: mozilla / 4.0 (compatible; msie 5.01; windows nt 5.0) Host: localhost: 8080connection: Keep-alive This request is issued by this HTML code:

This request has exceeded the scope of our research, and we only study the first line of them. Among them, the first "get" said that the submission is submitted in a GET method; the middle is to submit which program on the server, the front part "/cgi-bin/tech/meth/method.cgi" is our HTML The content of the Action, while the "get = get" is HTML's Form, INPUT content: We found that IE has converted this form to a specific format. In Perl, the data sent in GET is obtained by $ get = $ env {'query_string'}.

Let's take a request for a form submitted in a Post / CGI-BIN/Tech/Method.cgi http / 1.1accept: image / gif, image / x-xbitmap, image / jpeg, image / pjpeg, Application / VND .ms-powerpoint, application / vnd.ms-excel, application / msword, * / * refere: http://localhost//other.htmlaccept-language: en-cncontent-type: Application / X-www-form-urlencodedAccept -Encoding: Gzip, DeflateUser-agent: mozilla / 4.0 (compatible; msie 5.01; windows NT 5.0) Host: localhost: 8080content-length: 9connection: Keep-alive post = post also gives HTML: We found that the data ran to the bottom. In Perl, the data sent in POST is obtained via READ (stdin, $ post, $ env {'content_length'}). I remember that the GET sent data can only be 1024 bytes, and POST seems to be big! Thinking: If I have such an HTML code, what will it happen? This code may be used in many programs, but most people will not think about it, what is the content It is sent in GET, which content is sent in POST.

We look at its request: post /cgi-bin/tech/Method.cgi?get=get http / 1.1accept: image / gif, image / x-xbitmap, image / jpeg, image / pjpeg, Application / VND .ms-powerpoint, application / vnd.ms-excel, application / msword, * / * refere: http://localhost//other.htmlaccept-language: en-cncontent-type: Application / X-www-form-urlencodedAccept -ENCODING: GZIP, DeflateUser-agent: mozilla / 4.0 (compatible; msie 5.01; windows nt 5.0) Host: localhost: 8080content-length: 9connection: Keep-alive post = post Ha! It turned out to be sent in POST. However, you must find some of the data in the first line, just as the GET. In fact, this example is typical, it is POST and GET mixed! Don't believe in you in Perl, use read (stdin, $ post, $ env {'content_length'}) and $ get = env {'query_string'}, which is "get = get" data.

I will give you a device. Everyone goes to study: HTML section: get-post </ title> </ head> <body> <form action = "/ cgi-bin / tech / Method.cgi "Method =" get "> <input type =" text "size =" 10 "value =" get "name =" get "> <input type = submit value =" get mode> </ form> < Form action = "/ cgi-bin / tech / method.cgi" method = "post"> <input type = "text" size = "10" value = "post" name = "post"> <input type = Submit Value = "POST mode"> </ form> <form action = "/ cgi-bin / tech / method.cgi? Get = get" method = "post"> <input type = "text" size = "10" Value = "Post" name = "post"> <input type = submit value = "get / post method"> </ form> <form action = "/ cgi-bin / tech / method.cgi? Name = Hackfan & agn = 16 & email = Hackfan @ 163.net "Method =" post "> <input type =" text "size =" 10 "value =" suzhou "name =" address "> <input type =" text "size =" 10 "value =" MSger .NET "name =" homepage "> <input type =" text "size =" 10 "value =" 106814 "name =" qq "> <input type = Submit value =" Complex Get / Post Mode "> </ form > </ body> </ html> Perl section: #! c: /perl/bin/perl.exe $ | = 1; print "Content-type: text / html / n / n"; print "Send mode: $ ENV {'Request_Method'} <br> / N "; IF (Read (stdin, $ PO ST, $ ENV {'Content_length'</p></div><div class="text-center mt-3 text-grey"> 转载请注明原文地址:https://www.9cbs.com/read-104545.html</div><div class="plugin d-flex justify-content-center mt-3"></div><hr><div class="row"><div class="col-lg-12 text-muted mt-2"><i class="icon-tags mr-2"></i><span class="badge border border-secondary mr-2"><h2 class="h6 mb-0 small"><a class="text-secondary" href="tag-2.html">9cbs</a></h2></span></div></div></div></div><div class="card card-postlist border-white shadow"><div class="card-body"><div class="card-title"><div class="d-flex justify-content-between"><div><b>New Post</b>(<span class="posts">0</span>) </div><div></div></div></div><ul class="postlist list-unstyled"> </ul></div></div><div class="d-none threadlist"><input type="checkbox" name="modtid" value="104545" checked /></div></div></div></div></div><footer class="text-muted small bg-dark py-4 mt-3" id="footer"><div class="container"><div class="row"><div class="col">CopyRight © 2020 All Rights Reserved </div><div class="col text-right">Processed: <b>0.050</b>, SQL: <b>9</b></div></div></div></footer><script src="./lang/en-us/lang.js?2.2.0"></script><script src="view/js/jquery.min.js?2.2.0"></script><script src="view/js/popper.min.js?2.2.0"></script><script src="view/js/bootstrap.min.js?2.2.0"></script><script src="view/js/xiuno.js?2.2.0"></script><script src="view/js/bootstrap-plugin.js?2.2.0"></script><script src="view/js/async.min.js?2.2.0"></script><script src="view/js/form.js?2.2.0"></script><script> var debug = DEBUG = 0; var url_rewrite_on = 1; var url_path = './'; var forumarr = {"1":"Tech"}; var fid = 1; var uid = 0; var gid = 0; xn.options.water_image_url = 'view/img/water-small.png'; </script><script src="view/js/wellcms.js?2.2.0"></script><a class="scroll-to-top rounded" href="javascript:void(0);"><i class="icon-angle-up"></i></a><a class="scroll-to-bottom rounded" href="javascript:void(0);" style="display: inline;"><i class="icon-angle-down"></i></a></body></html><script> var forum_url = 'list-1.html'; var safe_token = 'WbmiOQNeZFRpa2tm_2BcYqw_2BDqBaTwRUCGI4CZXjLf4E3Q7Fi5J3bpnJRtfc_2BgnJOW5Pk1cOrUHfliHl2EDBxaHQ_3D_3D'; var body = $('body'); body.on('submit', '#form', function() { var jthis = $(this); var jsubmit = jthis.find('#submit'); jthis.reset(); jsubmit.button('loading'); var postdata = jthis.serializeObject(); $.xpost(jthis.attr('action'), postdata, function(code, message) { if(code == 0) { location.reload(); } else { $.alert(message); jsubmit.button('reset'); } }); return false; }); function resize_image() { var jmessagelist = $('div.message'); var first_width = jmessagelist.width(); jmessagelist.each(function() { var jdiv = $(this); var maxwidth = jdiv.attr('isfirst') ? first_width : jdiv.width(); var jmessage_width = Math.min(jdiv.width(), maxwidth); jdiv.find('img, embed, iframe, video').each(function() { var jimg = $(this); var img_width = this.org_width; var img_height = this.org_height; if(!img_width) { var img_width = jimg.attr('width'); var img_height = jimg.attr('height'); this.org_width = img_width; this.org_height = img_height; } if(img_width > jmessage_width) { if(this.tagName == 'IMG') { jimg.width(jmessage_width); jimg.css('height', 'auto'); jimg.css('cursor', 'pointer'); jimg.on('click', function() { }); } else { jimg.width(jmessage_width); var height = (img_height / img_width) * jimg.width(); jimg.height(height); } } }); }); } function resize_table() { $('div.message').each(function() { var jdiv = $(this); jdiv.find('table').addClass('table').wrap('<div class="table-responsive"></div>'); }); } $(function() { resize_image(); resize_table(); $(window).on('resize', resize_image); }); var jmessage = $('#message'); jmessage.on('focus', function() {if(jmessage.t) { clearTimeout(jmessage.t); jmessage.t = null; } jmessage.css('height', '6rem'); }); jmessage.on('blur', function() {jmessage.t = setTimeout(function() { jmessage.css('height', '2.5rem');}, 1000); }); $('#nav li[data-active="fid-1"]').addClass('active'); </script>