Echter in het contactformulier, heb ik nog twee variabelen meer.
"userPhone"
"userCity"
deze twee variabele wil ik ook in de $content van de email plaatsen
Wat is de juiste manier om dit te doen?
Ik heb diverse dingen (zonder success) geprobeerd als
$content = $_POST["userPhone","userCity","content"]
$content = $_POST["userPhone, userCity, content"]
$content = $_POST["userPhone"]+$_POST["userCity"]+$_POST["content"]
<?php
if(!empty($_POST["send"])) {
$name = $_POST["userName"];
$email = $_POST["userEmail"];
$subject = $_POST["reden"];
$content = $_POST["content"];
$toEmail = "[email protected]";
$mailHeaders = "From: " . $name . "<". $email .">\r\n";
if(mail($toEmail, $subject, $content, $mailHeaders)) {
$message = "Je bericht is succesvol verzonden.";
$type = "success";
}
}
require_once "contact-view.php";
?>