Posted by: tonyteaching | July 12, 2009

Email/Feedback Page using PHP

we need 2 files:

1. Form file for user to fill the feedback or email

2. a file for sending the data to our email

————————————————- For eaxample:

1. form.html

<font face=”arial” size=”2″> Any feedbacks or data that you want to update, please fill form below:<br>

<form method=”post” action=”sendmail.php“>
<b>Subject: </b> <input type=”text” name=”subject” size=”50″><br>
<b>Message: </b></font>
<textarea name=”message” rows=”5″ cols=”80″>
</textarea><br />
<input type=”submit” name=”send” value=”SEND” />


2. sendmail.php

if(isset($_POST[‘send’])) {

$to = “youremail@com”;

$subject = $_POST[‘subject’];
$message = $_POST[‘message’];

echo “<center><H3>Data has been submitted to Operator at $to!</center></H3>”;
echo “<center><H3><a href=’xxxx.php’>Back to DATABASE VIEW page</a></center></H2>”;
echo “<center><H3>or</center></H3>”;
echo “<center><H3><a href=’logout.php’>LOGOUT and back to HOME</a></center></H3>”;

mail($to, $subject, $message);

} else {

echo “This file can be accessed just from DBE page. Alternatively you can send email directly to youremail@com”;


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s


%d bloggers like this: