I need help with that Echo problem

General discussions related to php

Moderators: egami, macek, gesf

Post Reply
ElChico
New php-forum User
New php-forum User
Posts: 1
Joined: Sat Feb 10, 2018 12:00 pm

Sat Feb 10, 2018 12:02 pm

Why the echo it isn't showed?

<?php

$name = $_POST['Nume'];
$phone = $_POST['Telefon'];
$email = $_POST['Email'];
$subject = $_POST['Subiect'];
$message = $_POST['Mesaj'];
$formcontent = "*De la: $name \n *Telefon: $phone \n *Email: $email \n *Mesaj: $message";

if($name !='' && $email !='' && $subject !='' && $message !=''){
(mail('test@yahoo.ro', $subject, $formcontent);

echo "Mesaj trimis!";
}
else{
echo "Trebuie sa completezi toate campurile cu *";
}
?>

User avatar
hyper
php-forum Fan User
php-forum Fan User
Posts: 688
Joined: Mon Feb 22, 2016 5:52 pm

Sat Feb 10, 2018 2:03 pm

You have errors in your code, switch on display errors:

Code: Select all

(mail('test@yahoo.ro', $subject, $formcontent);

Post Reply