2011-02-01 10 views
-3

**이메일 ID에 제출 된 양식 세부 정보를 보내는 방법은 무엇입니까?

<html> 
<body> 
<?php 
print "<form name='frmone' action='s1show.php' method='post' enctype='multipart/form-data'>"; 
print "Enter Your Name : <input type='text' name='name' /> </br>"; 
print "Enter Your Qualification : <input type='text' name='qln' /> </br> "; 
print "Enter Your Place Living: <input type='text' name='place' /> </br> "; 
print "Enter Your Country Name : <input type='text' name='country' /> </br>"; 
print "<input type='submit' value='SUBMIT' onclick='javascript : return validatedetails();'>"; 
print "</form>"; 
?> 
</body> 
</html> 
<script language=javascript> 
function validatedetails() 
{ 
    if(document.frmone.name.value=="") 
    { 
    alert("Please Enter Your Name"); 
    frmone.name.focus(); 
    return false; 
    } 

    if(document.frmone.qln.value=="") 
    { 
    alert("Please Enter Your Qualification"); 
    frmone.qln.focus(); 
    return false; 
    } 

    if(document.frmone.place.value=="") 
    { 
    alert("Please Enter Your Place Name"); 
    frmone.place.focus(); 
    return false; 
    } 

    if(document.frmone.country.value=="") 
    { 
    alert("Please Enter Your Country Name"); 
    frmone.country.focus(); 
    return false; 
    } 

    frmone.submit(); 
    return true; 
} 
</script> 

프로세스는 더 '에서'매개 변수가 없습니다 .....

<html> 
<body> 
<?php 
$to="[email protected]"; 
$subject="Hello, sir/madam :"; 
$from="[email protected]"; 
$body ="The personal details are show below : \n\n"; 
$body .= "Name :" . $_REQUEST['name'] . "\n\n" ; 
$body .= "Qualification :" . $_REQUEST['qln'] . "\n\n" ; 
$body .= "Place Name :" . $_REQUEST['place'] . "\n\n" ; 
$body .="Country Name :" . $_REQUEST['country']; 
if(mail($to,$subject,$body,$from)) 
{ 
echo "Thank You, Your Details has been sent to your mail"; 
} 
else 
{ 
echo "Email has not been sent.."; 
} 
?> 
</body> 
</html> 

**

+2

코드를 제공했습니다 ... 여기서 겪고있는 문제점은 무엇입니까? –

+0

두 번째 Sarwar Erfan, 무엇을하려고합니까? –

답변

1

형태는 다음과 같습니다했다. 이것은 from, reply-to 및 otehr 헤더를 지정할 수있는 추가 헤더입니다. 당신이에서 지정하려는 경우, 당신은 이런 식의 헤더를 구성해야합니다

.... 
$header = "From: $from"; 
if(mail($to,$subject,$body,$header)) 
.... 

추가 예 php.net에서 찾을 수 있습니다.

+0

Downvoter,이 답변에 잘못된 점을 알려주세요. – GolezTrol

관련 문제