thanks a lot my dear friends
but again with the help my Friend Amitava i got the correct feedback form & it started working
Actually I wanted a Form in which their must be column Name, Email & Comment
& when a user fill the form & press submit than it mails the whole detail to my email id
So now i got the form
Now i am making a Javascript
so that if their is any field left blank than it will tell the user abt this before going to internet
anyways thanks
here's the codes
feedback.html
<HTML>
<HEAD>
<TITLE> Feedback </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
<!-- CSS Begin //-->
<STYLE type=text/css>
.f8 {FONT-SIZE: 8pt; FONT-FAMILY: arial}
.f9 {FONT-SIZE: 9pt; FONT-FAMILY: arial}
.f10 {FONT-SIZE: 10pt; FONT-FAMILY: arial}
.f11 {FONT-SIZE: 11pt; FONT-FAMILY: arial}
</STYLE>
<!-- CSS Ends //-->
</HEAD>
<BODY text=#000000 vLink=#d14F8F aLink=#005DA4 link=#005DA4 bgColor=#ffffff
leftMargin=0 topMargin=0 marginwidth="0" marginheight="0">
<TABLE cellSpacing=0 cellPadding=0 width=778 border=1>
<TBODY>
<TR>
<TD height=60 width="20"></td>
<TD height=60 width="738">
<img src="images/logo.gif"></img></TD>
<TD height=60 width="20"></td>
</TR>
</TBODY>
</table>
<TABLE cellSpacing=0 cellPadding=0 width=778 border=1>
<tbody>
<TR>
<TD height=30 width=778 bgcolor=999999 colspan=4></TD>
</TR>
<TR>
<TD width=778 height=25 bgcolor=CCCCCC style="BORDER-TOP: #ffffff 1px solid" class=f10 align="center" vAlign="center" colspan=4> FEEDBACK FORM
</TD>
<tr>
<TD width=778 height=300 bgcolor=CCCCCC class=f10 align="center" vAlign="top">
<br>
<form name="feedback" method="POST" action="feedback.php">
Name <input name="name" type="text"><br><br>
Email <input name="email" type="text"><br><br>
Phone <input name="phone" type="text"><br><br>
Feedback <textarea name="comments"></textarea><BR><br>
<input name="formbutton" type="submit" value="Submit">
<input name="formbutton2" type="reset" value="Reset">
</form>
</TD>
<tr>
</TR>
<TR>
<TD width=778 height=30 valign="top" bgcolor=999999 colspan=4>
</TD>
</TR>
</BODY>
</HTML>
feedback.php
<?
// ------------- CONFIGURABLE SECTION ------------------------
// $mailto - set to the email address you want the form
// sent to, eg
//$mailto = "youremailaddress@example.com" ;
$mailto = 'youremailaddress@example.com' ;
// $subject - set to the Subject line of the email, eg
//$subject = "online contact form" ;
$subject = "online contact form" ;
$formurl = "feedback/form.html" ;
$errorurl = "feedback/error.html" ;
$thankyouurl = "feedback/thankyou.html" ;
// -------------------- END OF CONFIGURABLE SECTION ---------------
$name = $_POST['name'] ;
$email = $_POST['email'] ;
$phone = $_POST['phone'] ;
$comments = $_POST['comments'] ;
$http_referrer = getenv( "HTTP_REFERER" );
if (!isset($_POST['email'])) {
header( "Location: $formurl" );
exit ;
}
if (empty($name) || empty($email) || empty($phone) || empty($comments)) {
header( "Location: $errorurl" );
exit ;
}
$name = strtok( $name, "\r\n" );
$email = strtok( $email, "\r\n" );
if (get_magic_quotes_gpc()) {
$comments = stripslashes( $comments );
}
$messageproper ="This message was sent from:\n" .
"$http_referrer\n" .
"NAME:\n" .
$name .
"\n" .
"\n" .
"EMAIL ID:\n" .
$email .
"\n" .
"\n" .
"PHONE NO:\n" .
$phone .
"\n" .
"\n" .
"------------------------- Enquiry -------------------------\n\n" .
$comments .
"\n\n------------------------------------------------------------\n" ;
mail($mailto, $subject, $messageproper, "From: \"$name\" <$email>\r\nReply-To: \"$name\" <$email>\r\nX-Mailer: chfeedback.php 2.04" );
header( "Location: $thankyouurl" );
exit ;
?>
error.html
error!!!. please fill in the details
thankyou.html
Thank you. we will get in touch with you shortly.
Zeeshan Quireshi said:
hey satyam can u tell me exactly what u want ur feedback form to do , then i'll programm one for ya .
thanks for the help
i have created one form which has javascript in it
so when a user press sumbit it identify which field is blank & which one is wrong
& at the same time give the error
but the form which i have given here use internet
i.e.
after pressing sumbit it sumbit the form use internet connection check & tells the error
can you tell me how i can integrate both form
So that at pressing submit button the person get error about the blank field without using internet connection
because this will save time
here's the code for Javascript Form
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
<script language="JavaScript">
<!--
function validate()
{
n1=document.form1.txt_name.value
p1=document.form1.txt_phone.value
e1=document.form1.txt_email_id.value
c1=document.form1.txt_comment.value
if(n1=="")
{
alert("Enter Your Name")
document.form1.txt_name.focus();
return false
}
else
{
for(i=0;i<n1.length;i++)
{
if ((n1.charAt(i)>'Z') && (n1.charAt(i)<'a') || (n1.charAt(i)<'A') ||
(n1.charAt(i)<'A'))
{
alert("Enter a Valid Name")
document.form1.txt_name.focus()
return false
}
}
}
if(p1=="")
{
alert("Enter Your Phone Number")
document.form1.txt_phone.focus();
return false
}
else
{
for(j=0;j<p1.length;j++)
{
if
((p1.charAt(j)<'0' || p1.charAt(j)>'9'))
{
alert("Enter a Valid Phone Number")
document.form1.txt_phone.focus()
return false
}
if (p1.length!=12 && p1.length!=8)
{
alert("Phone Number Must Contain 8 or 12 digit only")
document.form1.txt_phone.focus()
return false
}
}
}
if(e1=="")
{
alert("Enter Your Email ID")
document.form1.txt_phone.focus();
return false
}
if(c1=="")
{
alert("Please Enter Your Message")
document.form1.txt_phone.focus();
return false
}
}
-->
</script>
</HEAD>
<BODY>
<form id="contactus_form" action="feedback.php" method="post" name="form1">
<div align="center"><br>
<span class="fstyle">Name</span>
<input name="txt_name" type="text" class="textfield" id="name" value="" size="25" maxlength="255">
<br>
<br>
<span class="fstyle">Phone </span>
<input name="txt_phone" type="text" class="textfield" id="name" value="" size="25" maxlength="255">
<br>
<br>
<span class="fstyle">Email ID </span>
<input name="txt_email_id" type="text" class="textfield" id="name" value="" size="25" maxlength="255">
<br>
<br>
<span class="fstyle">Website</span>
<input name="txt_website" type="text" class="textfield" id="name" value="" size="25" maxlength="255">
<br>
<br>
<span class="fstyle">Comment</span>
<textarea name="txt_comment" cols="25" rows="3" class="fstyle" id="name"></textarea>
<br>
<br>
<input type="submit" name="Button" value="Submit" onClick="validate()";>
<input type="reset" name="submit2" value="Reset">
</div>
</FORM>
</BODY>
</HTML>