<form method="post" action="" id="infoform">
<label for="first">
First Name</label>
<input type="text" name="first" id="first" class="field validate[required]">
</br>
<label for="surname">
Last Name</label>
<input type="text" name="surname" id="surname" class="field validate[required]"> </br>
<label for="email">
Email</label>
<input type="text" name="email" id="email" class=" field email validate[required,custom[email]]">
</br>
<div class="radios">
<input id="test2" checked="checked" type="radio" name="message" value="register" />
Register for Updates</input>
<input id="test1" type="radio" name="message" value="msgs" />
Send a Message</input>
</div>
<div class="msg">
<label for="message" id="messagelabel">
Message</label>
<textarea type="text" name="message" id="message"></textarea>
</div>
<input id="submit" type="submit" value=""><div class="test3">
<a class="sbmt">Register</a></div>
<div class="test4">
<a class="sbmt">Send</a></div>
</input>
</form>
'test1'라디오 박스가 선택되면 div msg가 나타납니다. 이것은 다음 이메일 PHP 스크립트로 아약스를 통해 전송됩니다 라디오 체크 박스가 다른 이메일 필드를 전송하는 경우
<?php
$EmailTo = "[email protected]";
$adminSubject = "Civitas Message";
$firstName = Trim(stripslashes($_POST['first']));
$Surname = Trim(stripslashes($_POST['surname']));
$Email = Trim(stripslashes($_POST['email']));
$Message = Trim(stripslashes($_POST['message']));
$adminheaders = 'From: "Civitas website" <[email protected]>';
$adminBody .= "First Name: ";
$adminBody .= $firstName;
$adminBody .= "\n";
$adminBody .= "Surname: ";
$adminBody .= $Surname;
$adminBody .= "\n";
$adminBody .= "Email: ";
$adminBody .= $Email;
$adminBody .= "\n";
$adminBody .= "Message: ";
$adminBody .= $Message;
$adminBody .= "\n";
$adminMail = mail($EmailTo, $adminSubject, $adminBody, $adminheaders);
if ($adminMail){
echo "true";
}
else{
echo "false";
}
?>
그러나 나는 단지 메시지 상자가 표시되고있는 경우 전자 메일의 "메시지"부분은 전송하고자합니다. 어떻게해야합니까?
어디에서 "메시지"부분을 표시 하시겠습니까? 당신은 질문이 오히려 불분명합니다. 대답을 얻기 위해 편집해야합니다. – JMax