首页 \ 问答 \ 汽车轮胎问题

汽车轮胎问题

石桥=普利斯通??还是什么呢?石桥的轮胎怎么样呢?好吗?
更新时间:2023-03-26 21:03

最满意答案

您的email.php在REQUEST全球范围内具有特定的电子邮件地址,因此它会查找您的电子邮件地址的已发布字段。 如果您想发送到特定的电子邮件地址,只需将其列在字符串中,如下所示:

<?php
$subject = $_POST['subject'] . ' Ajax HTML Contact Form : Demo';
$to = 'omar@cinqomedia.com'; //Recipient's E-mail

$headers = 'MIME-Version: 1.0' . "rn";
$headers .= "From: " . $_POST['email'] . "rn"; // Sender's E-mail
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "rn";

$message = 'Name: ' . $_POST['name'] . "<br>";
$message .= $_POST['message'];

if (@mail($to, $subject, $message, $headers))
{
    // Transfer the value 'sent' to ajax function for showing success message.
    echo 'sent';
}
else
{
    // Transfer the value 'failed' to ajax function for showing error message.
    echo 'failed';
}

?>

在开始使用它之前,你的$ message变量还没有被定义,所以当你第一次使用时,你不需要'。='只是'='。

您可能需要考虑在发布的数据中添加一些过滤器。


Your email.php has the specific email address inside the REQUEST global, so its looking for a posted field of your email address. If you want to send to a specific email address just list it in a string like so:

<?php
$subject = $_POST['subject'] . ' Ajax HTML Contact Form : Demo';
$to = 'omar@cinqomedia.com'; //Recipient's E-mail

$headers = 'MIME-Version: 1.0' . "rn";
$headers .= "From: " . $_POST['email'] . "rn"; // Sender's E-mail
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "rn";

$message = 'Name: ' . $_POST['name'] . "<br>";
$message .= $_POST['message'];

if (@mail($to, $subject, $message, $headers))
{
    // Transfer the value 'sent' to ajax function for showing success message.
    echo 'sent';
}
else
{
    // Transfer the value 'failed' to ajax function for showing error message.
    echo 'failed';
}

?>

Also your $message variable hadn't been defined before you started using it so you didn't need the '.=' just an '=' when you first use it.

You might want to consider adding some filters to the data posted.

相关问答

更多
  • 您的email.php在REQUEST全球范围内具有特定的电子邮件地址,因此它会查找您的电子邮件地址的已发布字段。 如果您想发送到特定的电子邮件地址,只需将其列在字符串中,如下所示:
  • isset($_POST['submit'])正在检查密钥submit是否存在于客户端发布的日期中。 但是,从客户端发送的数据不包括它。 var posting = $.post(url, { name: $('#name').val(), email: $('#email').val(), message: $('#message').val() }); 要使其工作,您可以将其添加到POST数据中或检查服务器中的另一个键。 var posting = $.post(url, { ...
  • 如果您从ajax收到“确定”消息并且显示邮件已发送消息但仍未收到电子邮件,则需要检查您的php.ini的smtp服务器设置。 打开php.ini文件并查找以下设置: SMTP = smtp.gmail.com smtp_port = 25 username = youremail@gmail.com password = PASSWORD sendmail_from = webmaster@yourdomain.com 如果您不确定从哪里获取这些设置,您可以使用gmail的smtp服务器设置发送电子邮件 ...
  • 我很清楚为什么你的代码不能正常工作。 很久以前它发生在我身上。 您的代码无法正常工作的原因是: 当您在标题中传递“from”时,php需要您的现有电子邮件帐户 服务器。 例如: $headers = 'From: emailacc@yourserver.com'; 所以,首先要做的是在服务器上创建一个电子邮件帐户。 然后将From in header放入您刚刚创建的电子邮件地址。 $headers的From字段不是你想象的From 。
  • 实际上你应该能够使用Gmail。 这真的很慢。 使用 //SMTP server settings $host = 'tls://smtp.gmail.com'; $port = '587'; $username = 'david.lobstein@gmail.com'; $password = 'your_password'; 确保您的邮件库使用smtp。 否则使用phpmailer作为其他建议与上述设置。 Actually you should be able to use Gmail. It is ...
  • 再试一次,但从@mail()中取出@。 然后你应该看到一个错误,你可以把它包含在你的问题中。 Try it again but take the @ away from @mail(). Then you should see an error, and you can include it in your question.
  • 问题不在你的PHP中,而是在HTML和Javascript中,因为页面没有重新加载: HTML: 我认为最好写一下:
    因为当你像这样使用它时,它减少了编写MyFunction()的错误,而不是在提交按钮的onClick Listener中return MyFunction() JavaScript的: 你写了var e , var y , ...
  • mail()可能很难测试。 首先,您应该检查函数是返回true还是false。 如果它返回true则会被发送,但可能是电子邮件在路上遇到垃圾邮件阻止程序而且永远不会到达收件人。 我在我的一个网站上发生了这种情况,我们向主管中的域管理员发送了警告电子邮件。 托管公司的反垃圾邮件将我们的域名标记为垃圾邮件关键字,如果它们在其中的任何位置包含域名,则不会发送任何电子邮件。 我还在某处读到,起始地址必须是真实的电子邮件地址。 我从一个不存在但可能并不总是有用的地址发送了电子邮件。 mail() can be a d ...
  • 首先确保您已将机器主机设置为与域名相同,因为有时邮件服务器将拒绝没有匹配域的邮件头,例如Sender: test@test.org但From: localhost 。 然后,安装postfix,这样它将纠正电子邮件中的任何不正确/不正确的东西,最后,你错过了那里的电子邮件标题。 这是我的例子,对我有用:
  • Javascript不发送表单输入。 它需要一个data:选项来提供参数,它需要使用type: 'POST'所以它发送一个POST而不是GET 。 // Contact form var form = $('#main-contact-form'); form.submit(function(event){ event.preventDefault(); var form_status = $('
    '); $.ajax({ ...

相关文章

更多

最新问答

更多
  • 获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
  • 如何通过引用返回对象?(How is returning an object by reference possible?)
  • 矩阵如何存储在内存中?(How are matrices stored in memory?)
  • 每个请求的Java新会话?(Java New Session For Each Request?)
  • css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
  • 无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
  • xcode语法颜色编码解释?(xcode syntax color coding explained?)
  • 在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
  • 从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
  • 从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
  • 西安哪有PLC可控制编程的培训
  • 在Entity Framework中选择基类(Select base class in Entity Framework)
  • 在Android中出现错误“数据集和渲染器应该不为null,并且应该具有相同数量的系列”(Error “Dataset and renderer should be not null and should have the same number of series” in Android)
  • 电脑二级VF有什么用
  • Datamapper Ruby如何添加Hook方法(Datamapper Ruby How to add Hook Method)
  • 金华英语角.
  • 手机软件如何制作
  • 用于Android webview中图像保存的上下文菜单(Context Menu for Image Saving in an Android webview)
  • 注意:未定义的偏移量:PHP(Notice: Undefined offset: PHP)
  • 如何读R中的大数据集[复制](How to read large dataset in R [duplicate])
  • Unity 5 Heighmap与地形宽度/地形长度的分辨率关系?(Unity 5 Heighmap Resolution relationship to terrain width / terrain length?)
  • 如何通知PipedOutputStream线程写入最后一个字节的PipedInputStream线程?(How to notify PipedInputStream thread that PipedOutputStream thread has written last byte?)
  • python的访问器方法有哪些
  • DeviceNetworkInformation:哪个是哪个?(DeviceNetworkInformation: Which is which?)
  • 在Ruby中对组合进行排序(Sorting a combination in Ruby)
  • 网站开发的流程?
  • 使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)
  • 条带格式类型格式模式编号无法正常工作(Stripes format type format pattern number not working properly)
  • 透明度错误IE11(Transparency bug IE11)
  • linux的基本操作命令。。。