Hi WSBlue,
here is the script for your contact form page:
<?php
// Receiving variables
@$hubnamalengkap = addslashes($_POST['hubnamalengkap']);
@$hubalamat = addslashes($_POST['hubalamat']);
@$hubtelhp = addslashes($_POST['hubtelhp']);
@$hubemail = addslashes($_POST['hubemail']);
@$hubtanyasaran = addslashes($_POST['hubtanyasaran']);
// Validation
if (strlen($hubnamalengkap) == 0 )
{
header("Location:
error_page.html");
exit;
}
if (strlen($hubalamat) == 0 )
{
header("Location:
error_page.html");
exit;
}
if (strlen($hubtelhp) == 0 )
{
header("Location:
error_page.html");
exit;
}
if (strlen($hubemail) == 0 )
{
header("Location:
error_page.html");
exit;
}
if (strlen($hubtanyasaran) == 0 )
{
header("Location:
error_page.html");
exit;
}
//Sending Email to form owner
$pfw_header = "From: $hubemail\n"
. "Reply-To: $hubemail\n";
$pfw_subject = "Put your Subject here
";//Change it as you wish
$pfw_email_to = "
youremail@beruang.biz"; //
Put your own email in your account
$pfw_message = "hubnamalengkap: $hubnamalengkap\n"
. "hubalamat: $hubalamat\n"
. "hubtelhp: $hubtelhp\n"
. "hubemail: $hubemail\n"
. "hubtanyasaran: $hubtanyasaran\n";
*****($pfw_email_to, $pfw_subject ,$pfw_message ,$pfw_header ) ;
header("Location: thankyou_page.html");
?>
Please create the following pages in MSHTML: "error_page" and "thankyou_page". These must be simply BV pages. In the error page insert also a "Back" button to get them back in the form. To do so insert a html box in your page and paste there the following code:
<FORM>
<input type="button" class="but" value="< BACK TO THE FORM " onclick=history.go(-1)>
</FORM>
If you wish you may change the
header("Location: error_page.html"); after each field validation line (see above in red) creating separate error pages for every type of error.
Copy the code and paste it in notepad. After you have made the changes, go to "Save as", choose File Type "All files" and save it as "hubung.php". Also please change the encoding type in "multipart/form data". Save and republish your form, and upload the script on your site, in the same folder as the form itself.