I am trying to build a form where its contents will be emailed. I have been following this post here as I have never dealt with forms before nor PHP. I have the front-end of the form working, but am unsure if the back-end PHP portion will work.
My question is how would I test and deploy my PHP code onto my client's web host? I am assuming that to test I would have to install Apache and Mercury (via XAMPP) so that I would have a local mail server? How about when I deploy my code to my client's web host. Would I have to do any special configurations, or can I upload the files like I normally would?
Javascript (copied from here)
var data = "This is my email";
$.ajax({
type: "POST",
url: "email.php",
data: data,
dataType: "text"
});
PHP (also copied from here)
$to = "myself@hotmail.com";
$subject = "This is my email";
$message = $_REQUEST["data"];
$send = mail($to, $subject, $message);
if (!$send) {
die();
}