Ok, ive got my script down to mail a form using php, now the only thing i want to do, is send the person who fills out the form a reply with a small message.
This script was written with ALOT of help from a friend who does php for a living, and hes not around n e more so im almost complelty lost. I understand php basics but i wouldnt know where to start to auot send a reply to the person using the e-mail they provide.
Here is the form:
<style>
body
{
font-family: Tahoma, Verdana, Sans-Serif;
font-size: 11px;
margin-left: 10px;
margin-top: 20px;
margin-right: 125px;
}
td.center
{
text-align: center;
font-size: 11px;
font-family: Tahoma, Verdana, Sans-Serif;
color: #666666;
text-decoration: none;
font-weight: bold;
}
td.left
{
text-align: right;
font-size: 11px;
font-family: Tahoma, Verdana, Sans-Serif;
color: #666666;
text-decoration: none;
font-weight: bold;
}
td.right
{
text-align: left;
}
</style>
<html>
<head>
<title>.::TNT::. The N00b Trainers - Main Registration::.</title>
<?
function errOr() {
if($_GET['error']) {
echo "<font color=\"red\" size=\"3\">Please make sure all required fields have been completed!</font>";
}
}
function comPlete() {
if($_GET['complete']) {
echo "<font color=\"green\" size=\"3\">Thank you! Your request has been completed.<br>A response will be sent to you shortly!</font>";
}
}
?>
</head>
<body>
<div>
<?
errOr();
comPlete();
?>
<form action="regsubmit.php" method="post">
<table class="registration">
<tr>
<td colspan="2">.::Personal Info::.</td>
</tr>
<tr>
<td colspan="2"><img src="images/line.gif" width="300" height="5"></td>
</tr>
<tr>
<td class="left"><font color="red">*</font>Name:</td>
<td class="right"><input name="name" type="text" size="30" class="inputs"></td>
</tr>
<tr>
<td class="left"><font color="red">*</font>Handle:</td>
<td class="right"><input name="handle" type="text" size="30" class="inputs"></td>
</tr>
<tr>
<td class="left"><font color="red">*</font>Age:</td>
<td class="right"><input name="age" type="text" size="1" class="inputs"></td>
</tr>
<tr>
<td class="left"><font color="red">*</font>Location:</td>
<td class="right"><input name="location" type="text" size="30" class="inputs"></td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
<tr>
<td colspan="2">.::Contact Info::.</td>
</tr>
<tr>
<td colspan="2"><img src="images/line.gif" width="300" height="5"></td>
</tr>
<tr>
<td class="left"><font color="red">*</font>Email:</td>
<td class="right"><input name="email" type="text" size="30" class="inputs"></td>
</tr>
<tr>
<td class="left">Aim:</td>
<td class="right"><input name="aim" type="text" size="30" class="inputs"></td>
</tr>
<tr>
<td class="left">MSN:</td>
<td class="right"><input name="msn" type="text" size="30" class="inputs"></td>
</tr>
<tr>
<td class="left">Yahoo:</td>
<td class="right"><input name="yahoo" type="text" size="30" class="inputs"></td>
</tr>
<tr>
<td class="left">XFire:</td>
<td class="right"><input name="xfire" type="text" size="30" class="inputs"></td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
<tr>
<td colspan="2"><img src="images/line.gif" width="300" height="5"></td>
</tr>
<tr>
<td class="left"><font color="red">*</font>Reason for<br>registering:</td>
<td class="right">
<select name="reason" class="inputs">
<option></option>
<option>Newsletter</option>
<option>General Clan Registry</option>
<option>Scrim Tryouts Signup</option>
</select>
</td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
<tr>
<td align="center" colspan="2"><input type="submit"></td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
<tr>
<td align="center" colspan="2" class="center"><font color="red">* denotes a required field</font></td>
</tr>
</table>
</form>
</div>
and here is the regsubmit.php script:
<?
$name = $_POST['name'];
$handle = $_POST['handle'];
$age = $_POST['age'];
$location = $_POST['location'];
$email = $_POST['email'];
$aim = $_POST['aim'];
$msn = $_POST['msn'];
$yahoo = $_POST['yahoo'];
$xfire = $_POST['xfire'];
$reason = $_POST['reason'];
$subject = $reason . " Request:\r\n";
if((!$name) || (!$handle) || (!$age) || (!$location) || (!$email) || (!$reason)) {
header("Location: reg.php?error=1");
}
$message = "Registration Request:\r\n";
$message .= "Name: " . $name . "\r\n";
$message .= "Handle: " . $handle . "\r\n";
$message .= "Age: " . $age . "\r\n";
$message .= "Location: " . $location . "\r\n";
$message .= "Email: " . $email . "\r\n";
if($aim)
$message .= "Aim: " . $aim . "\r\n";
if($msn)
$message .= "MSN: " . $msn . "\r\n";
if($yahoo)
$message .= "Yahoo: " . $yahoo . "\r\n";
if($xfire)
$message .= "XFire: " . $xfire . "\r\n";
$to = "raidert05@triad.rr.com, [email]orionleingod@gmail.com[/email]";
$subject = $reason . " Request:\r\n";
$headers = "From: " . $email . "\r\n" . "Bcc: " . $bcc . "\r\n";
mail($to, $subject, stripslashes($message), $headers);
header("Location: reg.php?complete=1");
?>