Hello all,
I'm having an issue with receiving form data to my mail server.
It's very basic, but I need some experienced eyes on it.
It sends to the recipient (me) correctly, I receive the sender info in the email.
When sent, it directs the viewer to the page I want.
in the body of the email, I get this :
From:
E-Mail:
Message:
period : Within 1 month
It appears the "period" field is working correctly, however, some other fields are missing like the name and type field. It also looks like the message, and from fields carry no data over. In other words, I type in a message and click submit, message doesn't not appear in the email. Maybe the order has something to do with it, not sure but if anyone could take a look I would appreciate it.
Thanks
PHP Code:
<?php
$to = "myemail@mydomain.us";
$subject = "Contact Us";
$name = $_REQUEST['name'];
$tel = $_REQUEST['tel'];
$email = $_REQUEST['email'];
$type = $_REQUEST['type'];
$period = $_REQUEST['period'];
$message = $_REQUEST['message'];
$message = 'name : '.$name."\r\n";
$message = 'tel : '.$tel."\r\n";
$message = 'email : '.$email."\r\n";
$message = 'type : '.$type."\r\n";
$message = 'message : '.$message."\r\n";
$message = 'period : '.$period."\r\n";
$body = "From: $name_field\n E-Mail: $email_field\n Message:\n $message";
$headers = "From: $email"; $sent = mail($to, $subject, $body, $headers) ;
$name = $_REQUEST['name'];
header ('location: thanks.html') ;
?>