473,414 Members | 1,567 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,414 software developers and data experts.

Email - Query

Hi,

I did a feedback form in PHP. When i click the submit button, the form is submitted and the mail has been sent successfully and all the fields had been clear. But then if i click the refresh button, automatically a mail is sent with the previous data. Can anyone help me out.

Here is the Code:
-----------------------

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Falcon (c) Security Services - FeedBack</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<META HTTP-EQUIV="Refresh" CONTENT="90; URL=index.htm">
<link href="falcon.css" rel="stylesheet" type="text/css">
<script language="JavaScript"></script>
</head>

<body leftmargin="0" topmargin="0">
<table width="750" border="0" align="center" cellpadding="2" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td height="20" align="right" valign="middle" class="condent"> <a href="index.htm" class="sitelinks">Home</a> | <span>Feed Back</span>&nbsp;&nbsp;</td>
</tr>
</table>
<form name="_ctl0" method="post" action="Reply.php" id="_ctl0">
<table width="95%" border="0" align="center" cellpadding="10" cellspacing="0" id="tblFeedBack">
<tr>
<td align="left" class="content">Name <font color="red">&nbsp;*</font> </td>
<td>
<input name="txtName" id="txtName" type="text" class="textbox" size="25" />
</td>
</tr>

<tr>
<td align="left" class="content">Email ID <font color="red">&nbsp;*</font> </td>
<td>
<input name="txtEmailId" id="txtEmailId" type="text" class="textbox" size="25" />
</td>
</tr>

<tr>
<td align="left" class="content">Telephone <font color="red">&nbsp;*</font> </td>
<td>
<input name="txtTelephone" id="txtTelephone" type="text" class="textbox" size="25" />
</td>
</tr>

<tr>
<td align="left" class="content">Comments <font color="red">&nbsp;*</font></td>
<td>
<textarea name="txtComments" id="txtComments" class="textarea" rows="5" cols="25"></textarea></textarea>
</td>
</tr>

<tr><td> &nbsp; </td></tr>
<tr>
<td colspan = 2 align =center>
<input type="submit" name="btnSubmit" value="Submit" id="btnSubmit" class="content" OnClick="return Add();"/>
<input type="button" value="Clear" OnClick="Clear();" class = "content" name="clear" size="20">
<input type="button" value="Cancel" OnClick="Cancel();" class = "content" name="cancel" size="20">
</td>
</tr>
<?
$to = "pirai@falcon.net.in";
$subject = "Feedback";
$name = $_POST['txtName'] ;
$email = $_POST['txtEmailId'] ;
$telephone = $_POST['txtTelephone'] ;
$message = $_POST['txtComments'] ;
$headers = "From: $email";
$notes = stripcslashes($notes);
$feedback = "$name \n Email: $email \n Telephone: $telephone\n Comments: $message";
$sent = mail($to, $subject,$headers,$feedback) ;
if($sent)
{
print "Your mail was sent successfully";
}
else
{print "We encountered an error sending your mail"; }
?>
</table>
</form>
</body>
</html>

<script language="JavaScript" type="text/JavaScript">
function Add()
{
if (document.getElementById("txtName").value=="")
{
alert("Please Enter the Name")
document.getElementById("txtName").focus();
return false;
}


if (document.getElementById("txtEmailId").value=="")
{
alert("Please Enter the Email ID")
document.getElementById("txtEmailId").focus();
return false;
}
if (document.getElementById("txtTelephone").value=="" )
{
alert("Please Enter the Telephone")
document.getElementById("txtTelephone").focus();
return false;
}
if (document.getElementById("txtComments").value=="")
{
alert("Please Enter the Comments")
document.getElementById("txtComments").focus();
return false;
}

var PhoneNumber = /^[0-9\+\,\(\)\-\s]+/gi;
if(document.getElementById("txtTelephone").value!= "")
{
if(!PhoneNumber.test(document.getElementById("txtT elephone").value))
{
alert("* Phone Number accepts numbers and Special Characters.");
document.getElementById("txtTelephone").focus();
return false;
}
}
var EmailId = /^[a-zA-Z][\w\.-]*[a-zA-Z0-9]@[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]+/gi;

if(EmailId.test(document.getElementById("txtEmailI d").value) == false)
{
alert("* Please Enter Valid Email ID.");
document.getElementById("txtEmailId").focus();
return false;
}

}

function Clear()
{
document.getElementById("txtName").value = "";
document.getElementById("txtEmailId").value = "";
document.getElementById("txtTelephone").value = "";
document.getElementById("txtAddress").value = "";
document.getElementById("txtCity").value = "";
document.getElementById("txtCountry").value = "";
document.getElementById("txtComments").value = "";
}
function Cancel()
{
window.location.href("index.htm")
}
</script>
Nov 2 '06 #1
4 1952
vssp
268 100+
POst values are not set as null so again the same date send.
When post the vaklues and POSt array set as null not send the same values

Vssp
Nov 2 '06 #2
ronverdonk
4,258 Expert 4TB
Read the Posting Guidelines before you put anything here. For you: read the part about enclosing your code in code, php or html tags!!

Until then, I will not look at your code, it is absolutely unreadable!

Ronald :cool:
Nov 3 '06 #3
Read the Posting Guidelines before you put anything here. For you: read the part about enclosing your code in code, php or html tags!!

Until then, I will not look at your code, it is absolutely unreadable!

Ronald :cool:
Hi, Mr.Ronald am new to this Forum. So i donno the guidelines of how to post the questions here. You need not look at my code. Thanks for ur kind reply.
Nov 6 '06 #4
ronverdonk
4,258 Expert 4TB
Well, the first entry in this forum RIGHT AT THE TOP, contains these guidelines. You haven't been to many forums I presume, because they all have these guidelines and all of them want the shown code within tags.

So you don't want me to look at your code. Do you mean you want your thread deleted??

Ronald :cool:
Nov 6 '06 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: jason | last post by:
I could sure use some conceptualization and query help with a Page Watch System I am building in Access 2000 and Asp. I need to cycle through databae and generate a compiliation query email that...
0
by: cronept | last post by:
Hi, there, I have a form with 2 email buttons both with docmd.sendobject code. The 1st one send a report which is working properly. The 2nd one send a query in xls format which is always get an...
1
by: melsink | last post by:
I am trying find the best method to send email from my a contact access database. I would need to send group emails and save the transaction in access (is. time/date, subject of email and who the...
4
by: acni | last post by:
I have the following peice of code to try and send an email to selected contacts in my form.The problem is this line: StrStore = DLookup("", "qrySelectEmail", "??????") This looks up the email...
0
by: Phil Endecott | last post by:
Dear PostgreSQL people, I thought that some of you might be interested to know about Decimail, a new IMAP mail server that I've written that uses PostgreSQL to implement its message store. ...
36
by: Liam.M | last post by:
hey guys, I have one last problem to fix, and then my database is essentially done...I would therefore very much appreciate any assistance anyone would be able to provide me with. Currently I...
9
by: Jerim79 | last post by:
I am no PHP programmer. At my current job I made it known that I was no PHP programmer during the interview. Still they have given me a script to write with the understanding that it will take me a...
9
by: axlq | last post by:
I'm trying to figure out a MySQL query expression to match an email address. Here's the situation: User registers on my site with a "plus style" email address (username+key@example.com). This...
7
by: micarl | last post by:
I'm trying to create a new email message from Outlook based on a query called Q_Email with the BCC field populated with the email address field in the query. When i run this code, the query...
27
matheussousuke
by: matheussousuke | last post by:
I'm having trouble with e-mail sending, I mean, the website is suposed to send a confirmation email after sign up, but it gets like text plain instead of HTML May someone help me, please? ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.