仅通过URL提交网络表单? [英] Submit webform via URL only?

查看:146
本文介绍了仅通过URL提交网络表单?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不太确定这是否属于这里,因此与其讨价还价,不如让lemme知道是否是这样,然后我会继续进行下去.

I'm not really sure this belongs here, so instead of downvoting just lemme know if so and I'll quickly move it on.

无论如何,有一个网站具有一个搜索页面,当点击搜索按钮时,它不会在网址中添加搜索查询.

Anyway, there is a website that has a search page, that when hitting the search button it doesn't include the search query in the URL.

搜索完某些内容后,页面将重定向到 ssearch.asp ,但是,查询不存在.

After searching for something, the page is redirected to ssearch.asp, but as said, the query isn't there.

我的问题是是否有一种方法可以仅通过URL提交搜索值.

My question is if there is a way to submit the search values solely via URL.

我想知道是否有一种方法可以伪造搜索提交按钮并发布搜索词 通过URL根据表单字段名称.

I was wondering if there is a way to fake the search-submit button and post the search term via URL according to form field names.

输入框的名称为search,所以我尝试了以下URL: http ://www.torec.net/ssearch.asp?search = query ,但是它不起作用,服务器返回:

The name of the input box is search, so I tried this URL: http://www.torec.net/ssearch.asp?search=query, but it doesn't work, the server returns:

服务器错误.

server error.

请清楚一点,我不是在寻找服务器端解决方案,实际上也不是在寻找HTML解决方案,我只是想能够在浏览器地址栏中粘贴一个普通的旧URL,并在那里.

Just to be clear, I'm not looking for a server-side solution, and actually nor for a HTML solution, I just want to be able to paste a plain old URL in my browsers address bar and be there.

这可能吗?

更新

此链接无效:
http://www.torec.net/ssearch.asp?search=dark&page=1

This link doesn't work:
http://www.torec.net/ssearch.asp?search=dark&page=1

这是这样做的:
http://www.torec.net/ssearch.asp?search=dark&page=2

While this one does:
http://www.torec.net/ssearch.asp?search=dark&page=2

有什么办法可以绕过这个?

Any way to bypass this?

推荐答案

有时,服务器将GET和POST参数合并在一起,就像在PHP $_REQUEST哈希中一样.但是,通常它们是分开的-期望multipart/form-data中其参数的服务器可能根本不会查看URL.在这种情况下,您似乎必须构造一个POST请求.在客户端,您可以通过AJAX或通过构建和发布表单来完成此操作;在服务器端,您可以使用curl或库.

Sometimes servers conflate GET and POST parameters, as in PHP $_REQUEST hash. However, normally they are separate - and a server that expects its parameters in multipart/form-data might not look at URL at all. In such a case, as it seems to be here, you have to construct a POST request. On the client side you can do it through AJAX or through constructing and posting a form; on the server side, you can use curl, or a library. You did not say what you want to use it for (and where you want to use it), so you just get the general answer, I'm afraid.

这是JavaScript半解决方案.您必须已经在某个页面上(即无法在_blank上使用它),而且我不确定它是否适用于所有浏览器.

Here is the JavaScript semi-solution. You have to already be on some page (i.e. can't use it on _blank), and I'm not sure if it works on all browsers.

javascript:d=document;f=d.createElement("form");h=d.createElement("input");f.setAttribute("method","post");f.setAttribute("enctype","application/x-www-form-urlencoded");f.setAttribute("action","http://www.torec.net/ssearch.asp");h.setAttribute("type","hidden");h.setAttribute("name","search");h.setAttribute("value","query");f.appendChild(h);d.body.appendChild(f);f.submit();

这篇关于仅通过URL提交网络表单?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆