表单php脚本问题 - [英] form php script question -

查看:72
本文介绍了表单php脚本问题 - 的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好!



我的朋友正试图让更多人在ConstantContact上注册他的时事通讯,但他也希望将访客反馈直接邮寄给他。



我将他的HTML表单发布到服务器上的PHP文件中。 PHP目前处于1/2工作状态,因为它成功地向我发送了一封电子邮件,其中包含访问者评论。现在,我只需要它也将4个变量发送到ConstantContact。



如果是直接发布到ConstantContact的HTML表单,操作将是:action =http://visitor.r20.constantcontact.com/d。 jsp但它是PHP,所以我假设语法不同。



这是我当前的PHP文件成功1/2工作:

 <?  php   

$ emailSubject =' 客户有问题!' ;

$ webMaster =' 酒吧ry@page3design.com' ;



$ ea = $ _ POST [' ea'];

$ comments = $ _ POST ['comments'];

$ llr = $ _ POST ['llr'];

$ m = $ _ POST ['m'];

$ p = $ _ POST ['p'];



$ body = <<<< EOD

< br > < hr > < br >
电子邮件:$ ea < br >
评论:$ comments < br >
& nbsp; < br >
以下是发送给Constant Contact的四个变量:< br >
电子邮件:$ ea < br >
LLR:$ llr < br >
M:$ m < br >
P:$ p < br >

& nbsp; < br >
这些评论是从JW Secure网站的test.html页面发送的。 < br >
访问者已选中将其信息发送给Constant Contact的框。< br >
EOD;
$ headers =From:$ ea\r\ n;
$ headers。=Content-type:text / html\r\ n;

$ success = mail($ webMaster,$ emailSubject,$ body,$ headers);

$ theResults = < << EOD

< META < span class =code-attribute> http-equiv = 刷新 content = 0; URL = http://www.jwsecure.com/contact/thank-you/ >
EOD;

echo$ theResults;
?>





如果有帮助,这里是HTML的表格。隐藏变量只是ConstantContact的内容,所以我们每个都有值,我们只需将它们传递给CC。



 <  表格    action   =  SendToConstantContact.php   名称  =  myform   方法  = 发布    onsubmit   = 返回submitForm(this) >  
您的电子邮件*:< br / >
< 输入 type = text name = ea size = 39 value = < span class =code-keyword> style = font-size:10pt; > < br / >
< img src = images / transparent.gif width = 1 height = 9 alt = border = 0 / > < br / >
您的留言(可选):< br / >
< ; textarea name < span class =code-keyword> = comments cols = 30 = 3 style = font-size:10pt; >
< ; / textarea > < br / >
< ; img src < span class =code-keyword> = images / transparent.gif < span class =code-attribute> width = 1 height = 9 alt = border = 0 / > < br / >
< 输入 type = < span class =code-keyword> hidden name = llr = z4u4kndab >
< input type = hidden name = m value = 1103180583929 >
< 输入 type = 隐藏 name = p value = oi >

< input type = 提交 value = 提交 < span class =code-keyword> / >
< / form >





所以,我的问题是,我如何在PHP文件中做两件事? 1.发送电子邮件给Dan(这部分正在工作)和2.还通过这个PHP页面将变量发送到ConstantContact(我需要这部分的帮助)?



我试图在PHP网站上找到答案,但到目前为止它还没有找到我。感谢您的时间和专业知识。

-Barry

解决方案

emailSubject =' 客户有问题!' ;


webMaster =' barry@page3design.com' ;




ea =


Hi guys!

My friend is trying to get more people to sign up for his newsletter on ConstantContact, but he also wants to get visitor feedback mailed directly to him.

I have his HTML form posting to a PHP file on the server. That PHP is currently 1/2 working, as it successfully sends an email to me with the visitor comments in it. Now, I just need it to also send the 4 variables along to ConstantContact.

If it was an HTML form directly posting to ConstantContact, the action would be: "action="http://visitor.r20.constantcontact.com/d.jsp" but it is PHP, so I assume the syntax is different.

And here is my current PHP file that is successfully 1/2 working:

<?php

$emailSubject = 'Customer Has a Question!';

$webMaster = 'barry@page3design.com';



$ea = $_POST['ea'];

$comments = $_POST ['comments'];

$llr = $_POST ['llr'];

$m = $_POST ['m'];

$p = $_POST ['p'];



$body = <<<EOD

<br><hr><br>
Email: $ea <br>
Comments: $comments <br>
&nbsp;<br>
And below are the four variables sent to Constant Contact:<br>
Email: $ea <br>
LLR: $llr <br>
M: $m <br>
P: $p <br>

&nbsp;<br>
These comments were sent from the test.html page of the JW Secure site. <br>
The visitor has checked the box that would send their information to Constant Contact.<br>
EOD;
$headers = "From: $ea\r\n";
$headers .= "Content-type: text/html\r\n";

$success = mail($webMaster, $emailSubject, $body, $headers);

$theResults = <<<EOD

<META http-equiv="refresh" content="0;URL=http://www.jwsecure.com/contact/thank-you/">
EOD;

echo "$theResults";
?>



And if it helps, here is the form from the HTML. The hidden variables are just things for ConstantContact, so we have values for each of those, we just need to pass them along to CC.

<form action="SendToConstantContact.php" name="myform" method="post" onsubmit="return submitForm(this)">
Your email*:<br/>
<input type="text" name="ea" size="39" value="" style="font-size:10pt;"><br/>
<img src="images/transparent.gif" width="1" height="9" alt="" border="0" /><br/>
Your message (optional):<br/>
<textarea name="comments" cols="30" rows="3" style="font-size:10pt;">
</textarea><br/>
<img src="images/transparent.gif" width="1" height="9" alt="" border="0" /><br/>
<input type="hidden" name="llr" value="z4u4kndab">
<input type="hidden" name="m" value="1103180583929">
<input type="hidden" name="p" value="oi">

<input type="submit" value="Submit" />
</form>



So, my question is, how do I do 2 things in my PHP file? 1. send the email to Dan (this part is working) and 2. also send the variables to ConstantContact via this PHP page (I need help with this part)?

I've tried to find the answer on PHP sites but so far it has eluded me. Thank you for your time and expertise.
-Barry

解决方案

emailSubject = 'Customer Has a Question!';


webMaster = 'barry@page3design.com';


ea =


这篇关于表单php脚本问题 - 的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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