Free Contact Form will fectch you more details of your ecternal clients and you network of business will improve a lot. All product related enquiries can be solved online and it will be an ideal mode of providing a better service to your clients. Keeping all in our mind, we have generated a script with which the contact form can be installed easily in your website. Just copy the files into server and then give the link. And now, you will start receiving mails in your mail box.
<?
session_start();
$cansend=$HTTP_POST_VARS['cansend'];
if($cansend==1) {
require 'contact_setting.inc';
$mailTo = "$mailto";
$mailSubject="From ".$HTTP_POST_VARS["txtname"];
$name=$HTTP_POST_VARS["txtname"];
$company=$HTTP_POST_VARS["txtcompany"];
$address=$HTTP_POST_VARS["txtaddress"];
$phone=$HTTP_POST_VARS["txtphone"];
$fax=$HTTP_POST_VARS["txtfax"];
$email=$HTTP_POST_VARS["txtemail"];
$url=$HTTP_POST_VARS["txturl"];
$purpose=$HTTP_POST_VARS["txtpurpose"];
$comment=$HTTP_POST_VARS["txtcomment"];
$mailbody="Name :".$name;
$mailbody=$mailbody."\n Company :".$company;
$mailbody=$mailbody."\n Address :".$address;
$mailbody=$mailbody."\nPhone: ".$phone;
$mailbody=$mailbody."\nFax :".$fax;
$mailbody=$mailbody."\nEmail :".$email;
$mailbody=$mailbody."\nURL :".$url;
$mailbody=$mailbody."\nPurpose :".$purpose;
$mailbody=$mailbody."\nComments :".$comment;
if(1)
{
$status="<div align='center' class='highlight1' style='width: 750px;'>Thank you for contacting us. We will respond you shortly<br><br></div></center>";
}
else
{
$status="<center><br><br><br><div class='highlight1'>Problem in sending your request.</div></center>";
}
}
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Contact Form</title>
<style type="text/css">
<!--
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
-->
</style>
<link href="style/contact.css" rel="stylesheet" type="text/css" />
</head>
<body>
<table width="100%" border="0" align="left" cellpadding="0" cellspacing="0" background="images/bg.jpg" style=" border-left:1px solid #7f7f7f; border-right:1px solid #7f7f7f; border-bottom:1px solid #7f7f7f; ">
<tr>
<td colspan="10"><img src="images/logo.jpg" width="179" height="80" /></td>
</tr>
<tr>
<td colspan="2">&nbsp;</td>
<td colspan="8">&nbsp;</td>
</tr>
<tr>
<td width="2%" bgcolor="#EDEEFC" style="border-bottom:1px solid #cccccc; border-top:1px solid #cccccc">&nbsp;</td>
<td width="14%" bgcolor="#EDEEFC" style="border-bottom:1px solid #cccccc;border-top:1px solid #cccccc"><b>Contact Us </b></td>
<td colspan="8" bgcolor="#EDEEFC" style="border-bottom:1px solid #cccccc;border-top:1px solid #cccccc">&nbsp;</td>
</tr>
<?php
if($status) {
?>
<tr>
<td colspan="6">&nbsp;</td>
</tr>
<tr>
<td colspan="6"><?php echo $status;?></td>
</tr>
<tr>
<td colspan="6" align="center"><a href="javascript: history.go(-1)">Back</a></td>
</tr>
<?php
}
else {
?>
<tr>
<td colspan="2">&nbsp;</td>
<td colspan="8">&nbsp;</td>
</tr>
<form method="post" name=form1 action="contact.php" onSubmit="return validate();">
<tr>
<td colspan="2">&nbsp;</td>
<td width="23%" valign="top"><span>Name: </span></td>
<td colspan="7"><input name="txtname" type="text" style="width:250" maxlength="150" /></td>
</tr>
<tr>
<td colspan="10">&nbsp;</td>
</tr>
<tr>
<td colspan="2">&nbsp;</td>
<td valign="top"><span>Company Name: </span></td>
<td colspan="7"><input name="txtcompany" type="text" style="width:250" maxlength="150" /></td>
</tr>
<tr>
<td colspan="10">&nbsp;</td>
</tr>
<tr>
<td colspan="2">&nbsp;</td>
<td valign="top"><span>Address:</span></td>
<td colspan="7"><input name="txtaddress" type="text" style="width:250" maxlength="150" /></td>
</tr>
<tr>
<td colspan="10">&nbsp;</td>
</tr>
<tr>
<td colspan="2">&nbsp;</td>
<td valign="top"><span>Phone Number:</span></td>
<td colspan="7"><input name="txtphone" type="text" style="width:250" maxlength="150" /></td>
</tr>
<tr>
<td colspan="10">&nbsp;</td>
</tr>
<tr>
<td colspan="2">&nbsp;</td>
<td valign="top"><span>Fax Number: </span></td>
<td colspan="7"><input name="txtfax" type="text" style="width:250" maxlength="150" /></td>
</tr>
<tr>
<td colspan="10">&nbsp;</td>
</tr>
<tr>
<td colspan="2">&nbsp;</td>
<td valign="top"><span>E-mail id: </span></td>
<td colspan="7"><input name="txtemail" type="text" style="width:250" maxlength="150" /></td>
</tr>
<tr>
<td colspan="10">&nbsp;</td>
</tr>
<tr>
<td colspan="2">&nbsp;</td>
<td valign="top"><span>URL: </span></td>
<td colspan="7"><input name="txturl" type="text" style="width:250" maxlength="150" /></td>
</tr>
<tr>
<td colspan="10">&nbsp;</td>
</tr>
<tr>
<td colspan="2">&nbsp;</td>
<td valign="top"><span>Contact Purpose: </span></td>
<td colspan="7"><input name="txtpurpose" type="text" style="width:250" maxlength="150" /></td>
</tr>
<tr>
<td colspan="10">&nbsp;</td>
</tr>
<tr>
<td colspan="2">&nbsp;</td>
<td valign="top"><span>Comment ( if any ): </span></td>
<td colspan="7"><textarea name="txtcomment" cols="25"></textarea></td>
</tr>
<tr>
<td colspan="2">&nbsp;</td>
<td valign="top">&nbsp;</td>
<td colspan="7">&nbsp;</td>
</tr>
<tr>
<td colspan="2">&nbsp;</td>
<td valign="top">&nbsp;</td><input type="hidden" name="cansend" value="0">
<td width="22%"><input name="submit" type="submit" value = "Submit" /></td>
<td width="39%" colspan="6"><input name="reset" type="reset" value = "Reset" /></td>
</tr></form>
<?php } ?>
<tr>
<td colspan="2">&nbsp;</td>
<td valign="top">&nbsp;</td>
<td>&nbsp;</td>
<td colspan="6">&nbsp;</td>
</tr>
</table>
</body>
</html>
<script language="JavaScript">
function validate()
{
if(trim(document.form1.txtname.value) == "")
{
alert("Please Enter Your Name");
document.form1.txtname.focus();
return false;
}
if(trim(document.form1.txtcompany.value) == "")
{
alert("Please Enter Your Company Name");
document.form1.txtcompany.focus();
return false;
}
if(trim(document.form1.txtaddress.value) == "")
{
alert("Please Enter Your Address");
document.form1.txtaddress.focus();
return false;
}
phoneno = document.form1.txtphone.value;
len = phoneno.length;
if(len > 0)
{
for(i=0;i<len;i++)
{
x = phoneno.substr(i,1)
if( !( (x >= '0' && x <= '9') || x == '-') )
{
alert("Please Enter the valid Phone number");
document.form1.txtphone.focus();
return false;
}
}
}
faxno = document.form1.txtfax.value;
len = faxno.length;
if(len > 0)
{
for(i=0;i<len;i++)
{
x = faxno.substr(i,1)
if( !( (x >= '0' && x <= '9') || x == '-') )
{
alert("Please Enter the valid fax number");
document.form1.txtfax.focus();
return false;
}
}
}
if(trim(document.form1.txtemail.value) == "")
{
alert("Please Enter Your Email Id");
document.form1.txtemail.focus();
return false;
}
if( !isEmail(document.form1.txtemail.value) )
{
alert("Please Enter the Valid Email Id");
document.form1.txtemail.focus();
document.form1.txtemail.select();
return false;
}
if(trim(document.form1.txtpurpose.value) == "")
{
alert("Please Enter the Purpose");
document.form1.txtpurpose.focus();
return false;
}
document.form1.cansend.value=1;
return true;
}
function isEmail(emailstr)
{
dotchar = emailstr.indexOf(".");
atchar = emailstr.indexOf("@");
dotlast = emailstr.lastIndexOf(".");
spacechar = emailstr.indexOf(" ");
len = emailstr.length;
if( (dotchar == -1) || (atchar == -1) || (spacechar != -1) || (dotlast < atchar) || (dotlast == len - 1) )
{
return false;
}
else
{
return true;
}
}
function trim(str)
{
ch = '';
for(i=0;i<str.length;i++)
{
cha = str.charAt(i);
if(cha != ' ')
{
ch = ch + cha;
}
}
return ch;
}
</script>
&nbsp;
session_start();
$cansend=$HTTP_POST_VARS['cansend'];
if($cansend==1) {
require 'contact_setting.inc';
$mailTo = "$mailto";
$mailSubject="From ".$HTTP_POST_VARS["txtname"];
$name=$HTTP_POST_VARS["txtname"];
$company=$HTTP_POST_VARS["txtcompany"];
$address=$HTTP_POST_VARS["txtaddress"];
$phone=$HTTP_POST_VARS["txtphone"];
$fax=$HTTP_POST_VARS["txtfax"];
$email=$HTTP_POST_VARS["txtemail"];
$url=$HTTP_POST_VARS["txturl"];
$purpose=$HTTP_POST_VARS["txtpurpose"];
$comment=$HTTP_POST_VARS["txtcomment"];
$mailbody="Name :".$name;
$mailbody=$mailbody."\n Company :".$company;
$mailbody=$mailbody."\n Address :".$address;
$mailbody=$mailbody."\nPhone: ".$phone;
$mailbody=$mailbody."\nFax :".$fax;
$mailbody=$mailbody."\nEmail :".$email;
$mailbody=$mailbody."\nURL :".$url;
$mailbody=$mailbody."\nPurpose :".$purpose;
$mailbody=$mailbody."\nComments :".$comment;
if(1)
{
$status="<div align='center' class='highlight1' style='width: 750px;'>Thank you for contacting us. We will respond you shortly<br><br></div></center>";
}
else
{
$status="<center><br><br><br><div class='highlight1'>Problem in sending your request.</div></center>";
}
}
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Contact Form</title>
<style type="text/css">
<!--
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
-->
</style>
<link href="style/contact.css" rel="stylesheet" type="text/css" />
</head>
<body>
<table width="100%" border="0" align="left" cellpadding="0" cellspacing="0" background="images/bg.jpg" style=" border-left:1px solid #7f7f7f; border-right:1px solid #7f7f7f; border-bottom:1px solid #7f7f7f; ">
<tr>
<td colspan="10"><img src="images/logo.jpg" width="179" height="80" /></td>
</tr>
<tr>
<td colspan="2">&nbsp;</td>
<td colspan="8">&nbsp;</td>
</tr>
<tr>
<td width="2%" bgcolor="#EDEEFC" style="border-bottom:1px solid #cccccc; border-top:1px solid #cccccc">&nbsp;</td>
<td width="14%" bgcolor="#EDEEFC" style="border-bottom:1px solid #cccccc;border-top:1px solid #cccccc"><b>Contact Us </b></td>
<td colspan="8" bgcolor="#EDEEFC" style="border-bottom:1px solid #cccccc;border-top:1px solid #cccccc">&nbsp;</td>
</tr>
<?php
if($status) {
?>
<tr>
<td colspan="6">&nbsp;</td>
</tr>
<tr>
<td colspan="6"><?php echo $status;?></td>
</tr>
<tr>
<td colspan="6" align="center"><a href="javascript: history.go(-1)">Back</a></td>
</tr>
<?php
}
else {
?>
<tr>
<td colspan="2">&nbsp;</td>
<td colspan="8">&nbsp;</td>
</tr>
<form method="post" name=form1 action="contact.php" onSubmit="return validate();">
<tr>
<td colspan="2">&nbsp;</td>
<td width="23%" valign="top"><span>Name: </span></td>
<td colspan="7"><input name="txtname" type="text" style="width:250" maxlength="150" /></td>
</tr>
<tr>
<td colspan="10">&nbsp;</td>
</tr>
<tr>
<td colspan="2">&nbsp;</td>
<td valign="top"><span>Company Name: </span></td>
<td colspan="7"><input name="txtcompany" type="text" style="width:250" maxlength="150" /></td>
</tr>
<tr>
<td colspan="10">&nbsp;</td>
</tr>
<tr>
<td colspan="2">&nbsp;</td>
<td valign="top"><span>Address:</span></td>
<td colspan="7"><input name="txtaddress" type="text" style="width:250" maxlength="150" /></td>
</tr>
<tr>
<td colspan="10">&nbsp;</td>
</tr>
<tr>
<td colspan="2">&nbsp;</td>
<td valign="top"><span>Phone Number:</span></td>
<td colspan="7"><input name="txtphone" type="text" style="width:250" maxlength="150" /></td>
</tr>
<tr>
<td colspan="10">&nbsp;</td>
</tr>
<tr>
<td colspan="2">&nbsp;</td>
<td valign="top"><span>Fax Number: </span></td>
<td colspan="7"><input name="txtfax" type="text" style="width:250" maxlength="150" /></td>
</tr>
<tr>
<td colspan="10">&nbsp;</td>
</tr>
<tr>
<td colspan="2">&nbsp;</td>
<td valign="top"><span>E-mail id: </span></td>
<td colspan="7"><input name="txtemail" type="text" style="width:250" maxlength="150" /></td>
</tr>
<tr>
<td colspan="10">&nbsp;</td>
</tr>
<tr>
<td colspan="2">&nbsp;</td>
<td valign="top"><span>URL: </span></td>
<td colspan="7"><input name="txturl" type="text" style="width:250" maxlength="150" /></td>
</tr>
<tr>
<td colspan="10">&nbsp;</td>
</tr>
<tr>
<td colspan="2">&nbsp;</td>
<td valign="top"><span>Contact Purpose: </span></td>
<td colspan="7"><input name="txtpurpose" type="text" style="width:250" maxlength="150" /></td>
</tr>
<tr>
<td colspan="10">&nbsp;</td>
</tr>
<tr>
<td colspan="2">&nbsp;</td>
<td valign="top"><span>Comment ( if any ): </span></td>
<td colspan="7"><textarea name="txtcomment" cols="25"></textarea></td>
</tr>
<tr>
<td colspan="2">&nbsp;</td>
<td valign="top">&nbsp;</td>
<td colspan="7">&nbsp;</td>
</tr>
<tr>
<td colspan="2">&nbsp;</td>
<td valign="top">&nbsp;</td><input type="hidden" name="cansend" value="0">
<td width="22%"><input name="submit" type="submit" value = "Submit" /></td>
<td width="39%" colspan="6"><input name="reset" type="reset" value = "Reset" /></td>
</tr></form>
<?php } ?>
<tr>
<td colspan="2">&nbsp;</td>
<td valign="top">&nbsp;</td>
<td>&nbsp;</td>
<td colspan="6">&nbsp;</td>
</tr>
</table>
</body>
</html>
<script language="JavaScript">
function validate()
{
if(trim(document.form1.txtname.value) == "")
{
alert("Please Enter Your Name");
document.form1.txtname.focus();
return false;
}
if(trim(document.form1.txtcompany.value) == "")
{
alert("Please Enter Your Company Name");
document.form1.txtcompany.focus();
return false;
}
if(trim(document.form1.txtaddress.value) == "")
{
alert("Please Enter Your Address");
document.form1.txtaddress.focus();
return false;
}
phoneno = document.form1.txtphone.value;
len = phoneno.length;
if(len > 0)
{
for(i=0;i<len;i++)
{
x = phoneno.substr(i,1)
if( !( (x >= '0' && x <= '9') || x == '-') )
{
alert("Please Enter the valid Phone number");
document.form1.txtphone.focus();
return false;
}
}
}
faxno = document.form1.txtfax.value;
len = faxno.length;
if(len > 0)
{
for(i=0;i<len;i++)
{
x = faxno.substr(i,1)
if( !( (x >= '0' && x <= '9') || x == '-') )
{
alert("Please Enter the valid fax number");
document.form1.txtfax.focus();
return false;
}
}
}
if(trim(document.form1.txtemail.value) == "")
{
alert("Please Enter Your Email Id");
document.form1.txtemail.focus();
return false;
}
if( !isEmail(document.form1.txtemail.value) )
{
alert("Please Enter the Valid Email Id");
document.form1.txtemail.focus();
document.form1.txtemail.select();
return false;
}
if(trim(document.form1.txtpurpose.value) == "")
{
alert("Please Enter the Purpose");
document.form1.txtpurpose.focus();
return false;
}
document.form1.cansend.value=1;
return true;
}
function isEmail(emailstr)
{
dotchar = emailstr.indexOf(".");
atchar = emailstr.indexOf("@");
dotlast = emailstr.lastIndexOf(".");
spacechar = emailstr.indexOf(" ");
len = emailstr.length;
if( (dotchar == -1) || (atchar == -1) || (spacechar != -1) || (dotlast < atchar) || (dotlast == len - 1) )
{
return false;
}
else
{
return true;
}
}
function trim(str)
{
ch = '';
for(i=0;i<str.length;i++)
{
cha = str.charAt(i);
if(cha != ' ')
{
ch = ch + cha;
}
}
return ch;
}
</script>
&nbsp;