Hello everyone!
I've been having a helluva time trying to get a relatively simple script to work... I thought I had everything ironed out, and now I'm getting the following error:
Parse error: parse error in /home/.oakieovenoven/fetchdix/bethallan.com/cha/join.php on line 45
I don't know where I'm missing something or where I've added something that shouldn't be there... Anyway, the code isn't too long, so I've added it here.
Another set of eyes would be MUCH appreciated! Thank you!
<?
include("config.php");
include("$header");
if (!$action) { ?>
<p>Fill out the form below to submit your horse for registration. If you have more than one horse to register, please fill out a complete form for each horse. </p>
<FORM METHOD="POST" ACTION="join.php">
<INPUT TYPE="hidden" name="apr" VALUE="-">
<INPUT TYPE="hidden" name="action" VALUE="join">
<table border="0" cellspacing="0" cellpadding="2">
<tr></tr><td>Horse's Name:</td>
<td><INPUT TYPE="text" NAME="name" SIZE="40" class="form"></td>
<tr></tr><td>Horse's Breed:</td>
<td><INPUT TYPE="text" NAME="breed" SIZE="40" class="form"></td>
<tr></tr><td>Barn:</td>
<td><INPUT TYPE="text" NAME="barn" SIZE="40" class="form"></td>
</tr><tr><td>Owner's Name:</td>
<td><INPUT TYPE="text" NAME="country" SIZE="40" class="form"></td>
</tr><tr><td>Email:</td>
<td><INPUT TYPE="text" NAME="email" SIZE="40" class="form"></td>
<? if ($enablefave == 'Y'){ ?>
</tr><tr><td class="small"><?=$whatfave?>:</td>
<td><INPUT TYPE="text" NAME="fave" SIZE="40" class="form"></td>
<? } ?>
</tr><tr><td>Any comments/questions?</td>
<td><textarea rows="3" name="comments" cols="40" class="form"></textarea></td>
</tr><tr colspan="2"><td><div align="center"><INPUT TYPE="submit" NAME="Submit Button" value="Register!" SIZE="30" class="button"><INPUT TYPE="reset" NAME="Reset Button" value="Don't" SIZE="30" class="button"></div></td>
</tr></table></form>
<? } elseif ($action == "join"){
if (!isset($POST[name]) || !isset($POST[email]) || !isset($POST[country])) {
header( "$siteurl/join.php" );
}
elseif (empty($POST[name]) || empty($POST[email]) || empty($POST[country])) || (empty($POST[breed]) || (empty($POST[barn])) {
echo "<H2>Error</H2><P>Oops, it appears you forgot to fill out one of the fields on the form. Please press the BACK button in your browser and try again.</P>";
}
else {
$msg = "Horse's Name:\t$POST[name]\n";
$msg .= "Breed:\t$POST[breed]\n";
$msg .= "Barn:\t$POST[barn]\n";
$msg .= "Owner's Name:\t$POST[country]\n";
$msg .= "E-Mail:\t$_POST[email]\n";
if ($enablefave == 'Y'){
$msg .= "Fave:\t$_POST[fave]\n"; }
$msg .= "Comments:\t$_POST[comments]\n";
$msg .= "Sender IP:\t$REMOTE_ADDR\n";
$recipient = "$adminemail";
$subject = "Member $sitename";
$mailheaders = "From: $POST[email]\n";
$mailheaders .= "Reply-To: $POST[email]\n\n";
mail($recipient, $subject, $msg, $mailheaders);
if ($enablefave == 'Y'){
$query = "INSERT INTO $table VALUES ('','$name','$breed','$barn','$country','$email','$apr','$fave')";
mysql_query($query);
} else {
$query = "INSERT INTO $table VALUES ('','$name','$breed','$barn','$country','$email','$apr')";
mysql_query($query);
}
echo "<p>Thank you, $_POST[country]! You will be added to the members list with the next update. 🙂</p>";
}
} include("$footer");
?>