Html 将联系表单添加到静态网站
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/9533172/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Adding contact form to a static website
提问by mmln
I have to add a contact form to a static website. I already got some experience with forms, done 2 or 3 using django/python, but sadly using django is not an option here, it has to be added to a static website. Could you please tell me what options do I have?
我必须向静态网站添加联系表格。我已经对表单有了一些经验,使用 django/python 完成了 2 或 3 次,但遗憾的是,这里不能使用 django,必须将其添加到静态网站。你能告诉我我有哪些选择吗?
采纳答案by Uwe Keim
You could set up a Google Docs formto mimic a contact form and include the form into your website by using the snippet that Google tells you for your form.
您可以设置Google Docs 表单来模仿联系表单,并使用 Google 为您的表单提供的代码段将表单包含在您的网站中。
By using notification rulesyou can get automatic notifications, every time someone fills out the form.
通过使用通知规则,您可以在每次有人填写表单时收到自动通知。
回答by Sébastien Saunier
Have a look at Form Spree, you can simply add a <form>
with an action posting to their service, and get an email each time someone fills the form.
看看Form Spree,你可以简单地<form>
向他们的服务添加一个带有操作的帖子,每次有人填写表格时都会收到一封电子邮件。
Very efficient!
效率很高!
(Not suited for contact forms with a lot of submissions. Consider Wufooor the shiny new FormKeep)
回答by sdobson
If you are looking for a simple solution it doesn't get much easier than fwdform. I wrote it myself when I needed quick and dirty contact form processing on my own static site.
如果您正在寻找一个简单的解决方案,它不会比fwdform容易得多。当我需要在自己的静态站点上快速处理联系表单时,我自己编写了它。
To get your form forwarded to your email you just need to do the following.
要将您的表单转发到您的电子邮件,您只需执行以下操作。
1.Register
1.注册
Make an HTTP POST request to register your email.
发出 HTTP POST 请求以注册您的电子邮件。
$ curl --data "email=<your_email>" https://fwdform.herokuapp.com/register
Token: 780a8c9b-dc2d-4258-83af-4deefe446dee
2. Set up your form
2. 设置表格
<form action="https://fwdform.herokuapp.com/user/<token>" method="post">
Email: <input type="text" name="name"><br>
Name: <input type="text" name="email"><br>
Message: <textarea name="message" cols="40" rows="5"></textarea>
<input type="submit" value="Send Message">
</form>
You can even run it on your own Heroku instanceif you prefer not to trust a third-party service.
如果您不想信任第三方服务,您甚至可以在您自己的 Heroku 实例上运行它。
回答by Marcelo Biffara
回答by derekdac
There's a similar question here.
有一个类似的问题在这里。
The solution was to point to a PHP file on a different server, one that isn't static. knittlshows how to point the action attribute to a different server.
解决方案是指向另一台服务器上的 PHP 文件,该文件不是静态的。knittl展示了如何将 action 属性指向不同的服务器。
<form method="post" action="http://example.com/process.php">
<input type="text" name="my_textfield" />
<input type="submit" value="send!" />
</form>
One other alternative would be to use Wufoo forms, which you can embed in a static page.
另一种选择是使用Wufoo 表单,您可以将其嵌入到静态页面中。
回答by mmln
I just found a new answer to this question (and actually i find it the best one in some cases):
我刚刚找到了这个问题的新答案(实际上我发现它在某些情况下是最好的):
You can use podio.com which is a free (up to 5 members in one organisation) ERP
(Enterprise resource planning (ERP) systems integrate internal and external management information across an entire organization. (via wikipedia))
, that allows creation of fully customizable webform, that can be added anywhere you wish. What's more, the input that your webform gathers can be easily managed: for example added into you contact list, added to tasks so you can check wether you or someone from your team handled enquiries. More on that here: http://blog.podio.com/2012/08/07/styleyourwebform/
您可以使用 podio.com,这是一个免费的(一个组织中最多 5 个成员)ERP
(Enterprise resource planning (ERP) systems integrate internal and external management information across an entire organization. (via wikipedia))
,它允许创建完全可定制的网络表单,可以添加到您希望的任何位置。此外,您的网络表单收集的输入可以轻松管理:例如添加到您的联系人列表中,添加到任务中,以便您可以检查您或您团队中的某个人是否处理了查询。更多关于这里:http: //blog.podio.com/2012/08/07/styleyourwebform/
some pros:
一些优点:
- can be added anywhere you wish (you just have to specify subdomains its going to be used on)
- you can customize form in minutes
- you can add captcha (or some other spam protection) with one click
- you can easily manage webform leads
- 可以添加到您希望的任何位置(您只需指定将要使用的子域)
- 您可以在几分钟内自定义表单
- 您可以一键添加验证码(或其他一些垃圾邮件保护)
- 您可以轻松管理网络表单潜在客户
cons:
缺点:
- youd have to create a podio acc for every client you want to set up webform for in order to avoid sharing confidential info
- 您必须为要为其设置网络表单的每个客户创建一个 podio acc 以避免共享机密信息
回答by Andrew Bacon
Another option would be to use an iframe to sneak your dynamic form into the site.
另一种选择是使用 iframe 将您的动态表单潜入网站。
<iframe src="http://whatever.com/your-fancy-dynamic-form.php"></iframe>
回答by Fizer Khan
You can better use UserVoice
contact form. Uservoice
will do two things
您可以更好地使用UserVoice
联系表。Uservoice
会做两件事
It will create new ticket inside
Uservoice
system.It also send a mail to you.
它将在
Uservoice
系统内创建新票证。它还给你发邮件。
It will be end to end solutions for customer support. However if you send mail through some services, you have to communicate to your customer for support. Uservoice
will designed and built for customer support only.
它将是用于客户支持的端到端解决方案。但是,如果您通过某些服务发送邮件,则必须与客户联系以获得支持。Uservoice
将仅为客户支持而设计和建造。
I know, you have a questions that you want to use your own custom form, not the one provided as uservoice widget. Yes, you can do it by
我知道,您有一个问题想要使用自己的自定义表单,而不是作为用户语音小部件提供的表单。是的,你可以通过
回答by Wern Ancheta
If you're using Octopress or Jekyll for your static site. You might want to check out jekyll-contact: https://github.com/anchetaWern/jekyll-contactIt uses pooleappfor sending the contents of your contact form to an email you specify.
如果您的静态站点使用 Octopress 或 Jekyll。您可能想查看jekyll-contact:https: //github.com/anchetaWern/jekyll-contact它使用pooleapp将您的联系表单的内容发送到您指定的电子邮件。