Php form mail show bad looking window
Posted July 23rd 2013, 11:45am
I have a contact-form by php
<?php
$email = $_POST["email"];
$to = 'my@email' . ', ';
$to .= $email;
$subject = "contact form";
$message = $_POST["msg"];
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=utf-8' . "\r\n";
if(mail($to, $subject, $message, $headers))
{
echo "email has sent";
exit;
}
else{
echo "can not send email.";
}
?>


The window "email has sent" or "can not send email" is not good looking.
Do you have any solution for a better window?
φ
Posts: 35
Joined: May 23rd 2013, 9:51pm
Likes Received: 1
Php form mail show bad looking window
Posted July 24th 2013, 1:27pm
You should submit the form using AJAX and display the response in a pop-up box.

While it is designed for phpBB3, this topic will give you some ideas for creating the AJAX submission and displaying the response.

(Since you are doing no checking of user input, you might want to read this and note the requirements of the message field.)
φ
Posts: 1600
Joined: March 12th 2009, 11:00pm
Location: Uncertain due to momentum
Likes Given: 26
Likes Received: 357

Who is online

Users browsing this forum: No registered users and 0 guests