同一页面上有多个电子邮件地址的 SimpleModal 联系表
我有一个包含 5 个不同电子邮件地址的联系页面,例如 [电子邮件受保护], [电子邮件受保护],[email protected] 等...理想情况下,我希望每个链接都打开专门定制的不同版本的 contact.php对于该地址。我确信必须有一种方法将变量(contact_info.php 或 contact_feedback.php)从链接传输到 contact.js 以加载适当的 php 文件。任何帮助都会很棒。
非常感谢埃里克。我最终
<a href='#' id="info" class='contact'>[email protected]</a>
<a href='#' id="jobs" class='contact'>[email protected]</a>
在 contact.js 中执行了以下操作,我将链接更改为以下内容:
// load the appropriate contact form using ajax
$.get("data/contact_"+this.id+".php" , function(data){
然后我相应地保存了每个 contact_*php 实时
页面可以在此处找到 http://www.nashi.com.au/contact.html
I have a contact page with 5 different email addresses e.g. [email protected], [email protected], [email protected] etc... Ideally I would like each link to open a different version of contact.php that is customized specifically for that address. I'm sure there must be a way to transfer a variable (contact_info.php or contact_feedback.php) from the link to the contact.js to load the appropriate php file. Any help would be awesome.
Many thanks for that Eric. I ended up doing the following
<a href='#' id="info" class='contact'>[email protected]</a>
<a href='#' id="jobs" class='contact'>[email protected]</a>
in the contact.js I changed the link to the following:
// load the appropriate contact form using ajax
$.get("data/contact_"+this.id+".php" , function(data){
I then saved each contact_*php accordingly
Live page can be found here http://www.nashi.com.au/contact.html
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
由于您没有指定,我假设您正在使用联系表单演示。
一个建议:
1)为每个联系人链接分配一个 id:
2)修改
contact.js
文件以将 ID 传递给 contact.php 文件:3)修改
contact.php< /code> 文件来接收 id 并进行相应处理:
您可以创建不同的 php 文件(并相应地更改 JS),这取决于您。
-埃里克
Since you didn't specify, I'm assuming you are using the Contact Form Demo.
One suggestion:
1) assign an id for each contact link:
2) Modify the
contact.js
file to pass the ID to the contact.php file:3) Modify the
contact.php
file to receive the id and processing accordingly:You could create different php files (and change the JS accordingly), it's up to you.
-Eric