Hey people,
I don'r know much about PHP so I think you can help me on this one.
I have a email form and the action says:
<form id="contato" method="post" action="contact.php">
The php is placed as follows:
<?php
$to = "conde.taly@gmail.com";
$subject = "Site Contact" ;
$email = $_REQUEST['email'] ;
$message = "Name: ".nl2br($_POST["name"]. "\r\n");
$message .= "Email: ".nl2br($_POST["email"]. "\r\n");
$message .= "Message: ".nl2br($_POST["message"]);
$headers = "From: $email";
$headers .= "\nContent-Type: text/html; charset=UTF-8";
$headers .= "\nMIME-Version: 1.0";
$sent = mail($to, $subject, $message, $headers) ;
if($sent)
{print "Your mail was sent successfully"; }
else
{print "We encountered an error sending your mail"; }
?>
The thing is, I want that the user stay in the same page after submitting, with no redirects and no reloads!
I've tried also to put the {php with the html form} all together and call it from a javascript like
<script type="text/javascript" src="contact.php"></script>
In this way the php don't need to perform in another page, but doing that the form disapeared from the layout.
Can someone help me??