473,594 Members | 2,692 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Email - Query

2 New Member
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.cs s" rel="stylesheet " type="text/css">
<script language="JavaS cript"></script>
</head>

<body leftmargin="0" topmargin="0">
<table width="750" border="0" align="center" cellpadding="2" cellspacing="0" bgcolor="#FFFFF F">
<tr>
<td height="20" align="right" valign="middle" class="condent" > <a href="index.htm " class="sitelink s">Home</a> | <span>Feed Back</span>&nbsp;&nbs p;</td>
</tr>
</table>
<form name="_ctl0" method="post" action="Reply.p hp" 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">&nb sp;*</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">&nb sp;*</font> </td>
<td>
<input name="txtEmailI d" id="txtEmailId " type="text" class="textbox" size="25" />
</td>
</tr>

<tr>
<td align="left" class="content" >Telephone <font color="red">&nb sp;*</font> </td>
<td>
<input name="txtTeleph one" id="txtTelephon e" type="text" class="textbox" size="25" />
</td>
</tr>

<tr>
<td align="left" class="content" >Comments <font color="red">&nb sp;*</font></td>
<td>
<textarea name="txtCommen ts" 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.n et.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,$heade rs,$feedback) ;
if($sent)
{
print "Your mail was sent successfully";
}
else
{print "We encountered an error sending your mail"; }
?>
</table>
</form>
</body>
</html>

<script language="JavaS cript" type="text/JavaScript">
function Add()
{
if (document.getEl ementById("txtN ame").value=="" )
{
alert("Please Enter the Name")
document.getEle mentById("txtNa me").focus();
return false;
}


if (document.getEl ementById("txtE mailId").value= ="")
{
alert("Please Enter the Email ID")
document.getEle mentById("txtEm ailId").focus() ;
return false;
}
if (document.getEl ementById("txtT elephone").valu e=="")
{
alert("Please Enter the Telephone")
document.getEle mentById("txtTe lephone").focus ();
return false;
}
if (document.getEl ementById("txtC omments").value =="")
{
alert("Please Enter the Comments")
document.getEle mentById("txtCo mments").focus( );
return false;
}

var PhoneNumber = /^[0-9\+\,\(\)\-\s]+/gi;
if(document.get ElementById("tx tTelephone").va lue!="")
{
if(!PhoneNumber .test(document. getElementById( "txtTelephone") .value))
{
alert("* Phone Number accepts numbers and Special Characters.");
document.getEle mentById("txtTe lephone").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.getEl ementById("txtE mailId").value) == false)
{
alert("* Please Enter Valid Email ID.");
document.getEle mentById("txtEm ailId").focus() ;
return false;
}

}

function Clear()
{
document.getEle mentById("txtNa me").value = "";
document.getEle mentById("txtEm ailId").value = "";
document.getEle mentById("txtTe lephone").value = "";
document.getEle mentById("txtAd dress").value = "";
document.getEle mentById("txtCi ty").value = "";
document.getEle mentById("txtCo untry").value = "";
document.getEle mentById("txtCo mments").value = "";
}
function Cancel()
{
window.location .href("index.ht m")
}
</script>
Nov 2 '06 #1
4 1968
vssp
268 Contributor
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 Recognized Expert Specialist
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
elampirai
2 New Member
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 Recognized Expert Specialist
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
2065
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 notifies a person of yacht(s) that have changed on our website: Key database tables ---------------------------------------------------------------------------- Customer (1) --->> (many) Customer_Boats (many)<<---- Boat (1)
0
1880
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 error message say" .... can't save the output data to the file you selected." I am very confused. it used to work properly. And now, sometimes it works, most time it doesn't work. I am using ACC2000, outlook express and Win XP. below are the 2...
1
374
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 emails went to). Using MS Outlook 2003, I would like access to populate the to and cc fields in outlook. Thanks Mel
4
2796
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 field in the records returned for the query qrySelectEmail. The final bit needs to tell it to go to the first record the first time the loop runs, then the second record the second time the loop runs etc… But I cannot figure out a way to do this,...
0
1192
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. Decimail's unique feature is that mailboxes are defined using SQL queries. So for example you can match all messages to this list with this query:
36
3013
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 have set up a Query to show only records that meet a certain criteria...therefore excluding all of the records that do not meet this criteria (just for the record the criteria is any record within my database that falls within two months of its "Due...
9
2198
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 while (This information is just for general knowledge as I don't want anyone thinking I am trying to be dishonest with my intentions. Also, I do not portray myself as something I am not. I am a beginner.) Anyway, what the script needs to do is...
9
1611
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 is a perfectly legal address and I don't want to disallow it, because I use this style myself and find it useful. For example user+whatever@gmail.com will get delivered to user@gmail.com. Now, the user forgets his password. He is prompted to...
7
4697
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 ressults pop up with a message saying Object Required. Thoughts? Private Sub BCCMail_Click()
27
4805
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? Here's the code <?php require_once 'path_cnfg.php';
0
7880
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8255
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8374
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8010
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8242
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5413
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3903
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2389
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1486
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.