**
<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>
Process hit form is bel开发者_JAVA技巧ow.....
<html>
<body>
<?php
$to="rylonhunt@gmail.com";
$subject="Hello, sir/madam :";
$from="rylonhunt@gmail.com";
$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>
**
There is no 'from' parameter. This is the additional header in which you can specify from, reply-to and otehr headers. If you want to specify from, you should construct a header for it like this:
....
$header = "From: $from";
if(mail($to,$subject,$body,$header))
....
Additional examples can be found on php.net.
精彩评论