Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/security/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
PHP-已耗尽134217728字节的允许内存大小_Php_Email_Memory - Fatal编程技术网

PHP-已耗尽134217728字节的允许内存大小

PHP-已耗尽134217728字节的允许内存大小,php,email,memory,Php,Email,Memory,我有以下代码: <?php namespace Debug; function Alert($msg){ $temp = "<script>alert('".$msg."')</script>"; echo $temp; } function Log($msg){ $temp = "<script>console.log('".$msg."')</script>"; echo $temp; } function

我有以下代码:

<?php 
namespace Debug;

function Alert($msg){
   $temp = "<script>alert('".$msg."')</script>";
   echo $temp;
}

function Log($msg){
   $temp = "<script>console.log('".$msg."')</script>";
   echo $temp;
}

function Mail($message, $subject){
   $to = "email@email.com";

   // Sending email
   if(mail($to, $subject, $message)){
       echo 'Your feedback has been sent successfully.';
   } else{
       echo 'Unable to send feedback. Please try again.';
   }
}

?>

猜测它将进入一个无限循环。更新
邮件($to,$subject,$message)
\mail($to,$subject,$message)
,然后重试,因为您正在使用名称空间。在PHP中,函数名不区分大小写
\mail(…)
将调用全局PHP函数

<?php
    $name = $_POST['feedback_name'];
    $email = $_POST['feedback_email'];
    $msg = $_POST['feedback_message'];

    echo $name;
    echo $email;
    echo $msg;

    include 'WebLib.php';

    Debug\Mail($msg, "Feedback");
?>