I have the following code:
<?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.';
}
}
?>
Different file:
<?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");
?>
Since I wrote the Mail() function i get this error:
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 65488 bytes)