PHP mailer help

Associate
Joined
21 Mar 2007
Posts
41
Hi,

I'm trying to find out why I'm getting an error with the following code:

Form page:

<html>

<head>
<script type="text/javascript">
<!--
function validateForm()
{
var themessage = "Your form could not be submitted\n"
var valid = true
}
if (document.member.county.value=="")
{
themessage = (themessage + " \nPlease select your county")
valid = false;
}
if(valid == true)
{
return true;
} else {
alert (themessage)
return false;
}
}
</script>

</head>

<body bgcolor="#FFFFFF">

<form name="member" action="member_process.php" align="center" method="post" onsubmit="return validateForm()">
<font face="arial">
<table width="710" border="0" cellspacing="0" cell padding="2" valign="top">

<tr>
<td width="500" align="right">
County:</td>
<td width="10">&nbsp;</td>
<td width="200"> <select name="county">
<option selected="Choose"></option>
<option value="L1 Leics">Leicestershire</option>
</select></td>
</tr>

<input type="submit" class="button" value="Send" name="B1">

</form><br>

Process page:

<?php
if(isset($_POST['submit']))

{
$to = "<Email removed>";
$subject = "New Member";
$county = $_POST['county'];

$body = "$county"

mail($to, $subject, $body);
}

else
{
echo "bugger";
}

?>

Your form has been submitted, thankyou!


I'm trying to get the mailer to send me data from a drop down menu, however, it's just spitting out a Parse error: syntax error, unexpected T_STRING for line 9

Anyone see where I'm going wrong?
 
Back
Top Bottom