radical idea
try this, without the other 2 files (just use this)
save as form.php
<?
if (isset($_GET['action'])){$action = $_GET['action'];
if ($_GET['action'] == "send"){sendmail();}}
else {mailform();}
function mailform(){
?>
<html>
<head>
<title> php form test </title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="panamva.css" type="text/css">
</head>
<body>
<p align="center"><img border="0" src="images/layout_r2_c2.jpg" width="279" height="156" alt="Pan American Virtual Airlines, Virtual Flight Simulation Airline"><img border="0" src="images/layout_r2_c3.jpg" width="218" height="156"alt="Pan American Virtual Airlines, Virtual Flight Simulation Airline"><img border="0" src="images/layout_r2_c4.jpg" width="263" height="156"alt="Pan American Virtual Airlines, Virtual Flight Simulation Airline"></p>
<br>
<br>
<p align="center">
<form action="./form.php?action=send" method="post" enctype="multipart/form-data">
<table align="center" width="500" border="1" cellspacing="0" cellpadding="0">
<tr>
<td width="229" class="formfont">Full Name:</td>
<td width="265" class="forminput"><input type="text" name="fullname" size="30" style="font-family: Tahoma; font-size: 8pt; background-color: #E6E6E6; border: 1 solid #003366"></td>
</tr>
<tr>
<td class="formfont">State:</td>
<td class="forminput"><input type="text" name="state" size="5" style="font-family: Tahoma; font-size: 8pt; background-color: #E6E6E6; border: 1 solid #003366"></td>
</tr>
<tr>
<td class="formfont">Country (2 letter abbr.):</td>
<td class="forminput"><input type="text" name="country" size="30" style="font-family: Tahoma; font-size: 8pt; background-color: #E6E6E6; border: 1 solid #003366"></td>
</tr>
<tr>
<td class="formfont">VATSIM or IVAO ID: </td>
<td class="forminput"><input type="text" name="vatsim" size="30" style="font-family: Tahoma; font-size: 8pt; background-color: #E6E6E6; border: 1 solid #003366"></td>
</tr>
<tr></tr>
<td class="formfont">BVI Account # ([url]www.vastock.com[/url]) </td>
<td class="forminput"><input type="text" name="bviaccount" size="30" style="font-family: Tahoma; font-size: 8pt; background-color: #E6E6E6; border: 1 solid #003366"></td>
</tr>
<tr>
<td class="formfont">Hub (domicile) Preference: </td>
<td class="forminput"><input type="text" name="hub" size="30" style="font-family: Tahoma; font-size: 8pt; background-color: #E6E6E6; border: 1 solid #003366"></td>
</tr>
<tr>
<td class="formfont">Desired Password: </td>
<td class="forminput"><input type="text" name="passwd" size="30" style="font-family: Tahoma; font-size: 8pt; background-color: #E6E6E6; border: 1 solid #003366"></td>
</tr>
<tr>
<td class="formfont">Email:</td>
<td class="forminput"><input type="text" name="email" size="30" style="font-family: Tahoma; font-size: 8pt; background-color: #E6E6E6; border: 1 solid #003366"></td>
</tr>
<tr>
<td class="formfont">Birth Date (mm/dd/yyyy) </td>
<td class="forminput"><input type="text" name="birthdate" size="30" style="font-family: Tahoma; font-size: 8pt; background-color: #E6E6E6; border: 1 solid #003366"></td>
</tr>
<tr>
<td class="formfont">Flight Hours you Would Like to Claim:</td>
<td class="forminput"><input type="text" name="prevhours" size="30" style="font-family: Tahoma; font-size: 8pt; background-color: #E6E6E6; border: 1 solid #003366"></td>
</tr>
<tr>
<td class="formfont">Link to verify the Hours: </td>
<td class="forminput"><input type="text" name="linkverify" size="30" style="font-family: Tahoma; font-size: 8pt; background-color: #E6E6E6; border: 1 solid #003366"></td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td colspan="2" valign="top" align="center">By submitting this application the following statements are true;<br>
<br>
I Agree with Pan Am Virtual Airlines Terms and Conditions.<br>
I have read and I understand the Pan Am Virtual Airlines Pilot Handbook.<br>
<br>
<input type="submit" name="submit" value="Submit Pilot Application"></td>
</tr>
</table>
</form>
</p>
</body>
</html>
<?
}
function sendmail(){
$priority = 0; // Should the email be sent with priority? (0 = No, 1 = Yes)
$toemail = $_POST['email']; // Who do you want to send the email to?
$toemail .= ", [email]second@email.add[/email]"; // Who do you want to send the email to?
$mail = "
<html>
<head>
<title>The contents of the form submitted at WEBSITE</title>
</head>
<body>
Here are the contents of the form:<br><br>";
foreach ($_POST as $key => $value){
$mail .= "<b>$key</b>: ".nl2br($value)." <br>";
}
$mail .= "
</body>
</html>
";
$headers = "MIME-Version: 1.0\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\n";
if ($priority){
$headers .= "X-Priority: 1\n";
$headers .= "X-MSMail-Priority: High\n";
}
$headers .= "X-Mailer: php\n";
$headers .= "From: \"$_POST[fullname]\" <$_POST[email]>\n";
mail ($toemail, "Form sent from: WEBSITE", $mail, $headers);
$dbcxn = mysql_connect("$host","$user","$pswd");
if (!$dbcxn) die ("Could not connect MySQL");
mysql_select_db($dbname,$dbcxn) or die ("Could not open database");
$sql = "INSERT INTO Pilots (PilotID, Name, State, Country, Email, Passwd, BirthDate, Vatsim, BVIAccount, HubID) VALUES ('$PilotID', '$fullname', '$state', '$country', '$email', '$passwd', '$birthdate', '$vatsim', '$bviaccount', '$hub')";
$result = mysql_query($sql);
echo 'Thank you for your submission.<br /><br />'.$mail.'<br />
</body>
</html>';
}
dofooter();
?>
you will need to enter dbconnect info