使用 Dreamweaver 将 POST 转换为 GET - 使用 HTML、ColdFusion 和 JavaScript
我是一名计算机科学二年级学生,正在南达科他州地质调查局实习。我被雇用来帮助处理数据库,但此后的任务是更新网页、创建 JavaScript 内容等。我仍在学习 CFML、JavaScript 和 DHTML 的细节。您能提供的任何帮助将不胜感激!
问题:我们访问多个科学数据库的网页都是用方法=“POST”的表单编写的。我们部门更喜欢method =“GET”,这样我们就可以创建永久链接并在其他网页中引用结果。我已经使用 Dreamweaver 的设计视图以及手动查看代码浏览了所有 html 和 .cfm 文件,并将我的网页测试副本上的所有表单引用更改为 GET。我没有更改任何其他内容,但将 POST 更改为 GET 会破坏页面并给出 HTTP 500 内部服务器错误。
我已通读
http://www.communitymx.com/content/article。 cfm?cid=E078CF4BDCC45632
和许多其他页面,以及我的 DHTML 桌面参考,试图找出是什么破坏了它,但我不得不承认我被困住了。当我将引用更改回 POST 时,我的测试页面再次工作。
有问题的网页在这里:
http://www.sdgs.usd.edu/other/ db.html
具体来说,是岩性测井数据库。
如果您能提供任何意见或帮助,我们将不胜感激 - 非常感谢您的宝贵时间!
I'm a second-year CS student working on an internship with the South Dakota Geological Survey. I was hired to help with the databases but have since been tasked with updating webpages, creating JavaScript content, etc. I am still learning the ins and outs of CFML, JavaScript, and DHTML. Any help you can offer would be appreciated!
The problem: Our webpages, which access several scientific databases, were all written with forms where method ="POST". Our department would prefer method = "GET", so that we can create a permanent link and reference the results in other webpages. I've gone through all of the html and .cfm files, using Dreamweaver's design view as well as looking through the code manually, and changed all of the form references to GET on my test copy of the webpage. I haven't changed anything else, but changing POST to GET breaks the page and gives me a HTTP 500 Internal Server Error.
I've read through
http://www.communitymx.com/content/article.cfm?cid=E078CF4BDCC45632
and many other pages, as well as my DHTML desk reference to try and figure out what's breaking it, but I have to admit I'm stuck. When I change the references back to POST my test page works again.
The webpage in question is here:
http://www.sdgs.usd.edu/other/db.html
Specifically, the Lithologic Logs database.
Any input or assistance you could offer would be greatly appreciated- thanks so much for your time!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
好的,当您将信息发送到 .cfm 页面时,要么通过 POST 要么通过 GET。如果您发布信息,则 .cfm 页面将使用表单范围访问这些变量。如果您获取信息(即将所有数据放入 URL 查询字符串中),则 .cfm 页面将使用 URL 范围访问这些变量。
因此,请检查发生错误的页面。它很可能引用类似 form.foobar 的内容,然后您需要将其更改为 url.foobar。
ok, when you send information to a .cfm page, either it'll be by POST or GET. If you POST information, then the .cfm page accesses those variables using the Form scope. If you GET information (i.e. put all the data into the URL querystring), then the .cfm page accesses those variables using the URL scope.
So check the page the error happens on. Chances are it's referring to something like form.foobar and you'll need to then change it to url.foobar.
添加
到 Application.cfc 内的 onRequestStart。
Add
to onRequestStart inside of Application.cfc.