【问题标题】:Execute codes in a different page but remain on the same actual php page在不同的页面中执行代码,但保留在相同的实际 php 页面上
【发布时间】:2011-02-06 11:25:14
【问题描述】:

我在这里有一个复杂的问题..我有使用 PEAR 发送邮件的代码,我在一个名为 testmail.php 的 php 页面中进行了测试。 现在我有我的实际应用程序一个名为 Cart.php 的页面,其中我有一个名为 Place Order 的按钮。当我单击此按钮时,它实际上重定向到一个名为: http://localhost/final/index.php?OrderSuccessful 实际上在页面上显示一条消息并发送一封电子邮件。问题是当我将电子邮件代码放入 Cart.php 时,我得到了错误。但是当我输入网址http://localhost/final/testmail.php 时,它确实有效。 所以我在想,有没有办法通过留在页面 Cart.php 上来执行 testmail.php 中的代码?

include('Mail.php');
$mail = Mail::factory("mail");

$headers = array("From"=>"xyz@gmail.com", "Subject"=>"Your order has been placed   ");
$body = "lol";
$mail->send("abc@live.com", $headers, $body);

我得到了错误

将new的返回值赋值为 引用已弃用

【问题讨论】:

  • ERRNO: 8192 TEXT:不推荐通过引用分配 new 的返回值位置:C:\xampp\php\PEAR\Mail.php,第 154 行,
  • Deprecated 通常不应该是一个错误。也许您可以更改您的 error_reporting 设置,然后您可以忽略它 - php.net/manual/en/errorfunc.configuration.php

标签: php email pear


【解决方案1】:

好像你有旧代码。请按照此处的提示操作:

ERRNO: 8192 when trying to send mail

【讨论】:

    猜你喜欢
    • 2013-06-10
    • 1970-01-01
    • 2012-06-09
    • 1970-01-01
    • 2022-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多