我的联系表没有通过电子邮件发送电话号码。我在表单和脚本中都有该字段。
<form id="contact" action="">
<fieldset>
<label for="name" id="name_label">Name <br /></label>
<input type="text" name="name" id="name" value="" class="text-input" />
<label for="email" id="email_label">E-mail<br /></label>
<input type="text" name="email" id="email" value="" class="text-input" />
<label for="phone" id="phone_label">Phone number<br /></label>
<input type="text" name="phone" id="phone" value="" class="text-input" />
<label for="msg" id="msg_label">Preferred contact time</label>
<textarea cols="60" rows="10" name="msg" id="msg" ></textarea> <br class="clear" />
<input type="submit" name="submit" class="button" id="submit_btn" value="Send Message →"/>
</fieldset>
</form>
和以下 PHP 脚本:
<?php
$emailTo = 'test@test.co.uk';
$subject = 'Advanced Contact Form';
$name=$_REQUEST['name'];
$email=$_REQUEST['email'];
$phone=$_REQUEST['phone'];
$msg=$_REQUEST['msg'];
$body = "Name: $name \n\nEmail: $email \n\nphone: $phone \n\nMessage: $msg";
$headers = 'From: '.$name.' <'.$email.'>' . "\r\n" . 'Reply-To: ' . $email;
mail($emailTo, $subject, $body, $headers);
echo 'Mail sent';
?>
电子邮件发送正常,但电话号码未显示在电子邮件中。任何想法可能是什么问题?
编辑:我的网址如下所示:
www.website.com/contact.html?name=test&email=test%40test.com&phone=0112+2255555&msg=2312312312312&submit=Send+Message+%26%238594%3B