I have a form on a website that has been in use for just over a year. The owner of the site just informed me that the form no longer includes the subject when it gets emailed to him, everything else works just fine. He does not know how long this has been going on either. I looked at the sendmessage.php file to see if it had been edited, it had not been touched since I uploaded it last September. The only thing I can think is that a setting in PHP is blocking the mail subject from being sent through. Below I have copied the code from the sendmessage.php as well as the code for the form on the page. Any help is greatly appreciated.
Oh, server config is as follows:
cPanel Version 11.52.0 (build 21)
Theme paper_lantern
Apache Version 2.2.27
PHP Version 5.3.27
MySQL Version 5.5.46-cll
Architecture i686
Operating System linux
Shared IP Address ******
Path to Sendmail /usr/sbin/sendmail
Path to Perl /usr/bin/perl
Perl Version 5.10.1
Kernel Version 2.6.32-042stab094.7
sendmessage.php contents:
[php]<?php
$sendto = "[email protected]";
//new variables
$getconame = $_POST[‘coname’];
$getname = $_POST[‘username’];
$getcellphone = $_POST[‘cellphone’];
//end new variables
$usermail = $_POST[‘email’];
$content = nl2br($_POST[‘msg’]);
$getsubject = $_POST[‘subj’];
$subject = “”.$subj."";
$headers = "From: " . strip_tags($usermail) . “\r\n”;
$headers .= "Reply-To: ". strip_tags($usermail) . “\r\n”;
$headers .= “MIME-Version: 1.0\r\n”;
$headers .= “Content-Type: text/html;charset=utf-8 \r\n”;
$msg = “”;
$msg .= "
$msg .= “
Sent by: “.$usermail.”
\r\n”;//new fields
$msg .= “
Company: “.$getconame.”
”;$msg .= “
Name: “.$getname.”
”;$msg .= “
Email: “.$usermail.”
\r\n”;$msg .= “
Cell #: “.$getcellphone.”
\r\n”;$msg .= “
Message: “.$content.”
\r\n”;$msg .= “”;
if(@mail($sendto, $subject, $msg, $headers)) {
echo “true”;
} else {
echo “false”;
}
?>
[/php]
form on website
Company | |
Name | |
Cell phone | |
<label align="center" for="msg">Enter a Message</label>
<textarea id="msg" name="msg" class="txtarea"></textarea>
<button id="send">Send E-mail</button>
</form>