Helps? o___o

+1 Savad Dekrup · October 16, 2014
if (isset($_POST['email']) && isset($_POST['fn']) && isset($_POST['ln']) && isset($_POST['message'])){

$email = htmlentities($_POST['email']);
$firstName = htmlentities($_POST['fn']);
$lastName = htmlentities($_POST['ln']);
$message = htmlentities($_POST['message']);

if (filter_var($email, FILTER_VALIDATE_EMAIL)){
$to = ""; //Your Email Address
$subject = "Feed Back From " . $email; //Email Subject 
$headers = "From " . $firstName . " " . $lastName; //From
mail($to,$subject,$message,$headers); //Your Email, Email Subject, Email Message, Email From

echo "Yup!";
echo "Email is invalid. Please try again"; 

echo "Nope.";

<!DOCTYPE html>

<form method="POST" action="<?php $_SERVER['PHP_SELF']; ?>" autoComplete="off">
Email:<br/><input type="text" placeHolder="Email Address" name="email"/><br/>
First Name:<br/><input type="text" placeHolder="First name" name="fn" /><br/>
Last Name:<br/><input type="text" placeHolder="Last name" name="ln" /><br/>
Message:<br/> <textarea placeHolder="Message..." name="message" cols="20"rows="5"></textarea><br/>
<input type="submit" value="Submit"/>


I don't know why it doesn't work. Can anyone tell me why? o___o...

Post a Reply


Oldest  Newest  Rating
0 Savad Dekrup · October 16, 2014
So, the problem was the script works but somehow I didn't recieve the message.
0 Mayowa Olaitan · October 17, 2014
Check the mail function
0 Savad Dekrup · October 18, 2014
Check what? I mean, what do you mean by that... 
  • 1



Server-side, HTML embedded scripting language used to create dynamic Web pages.