Jun 22nd, 2009, 5:06 AM
I have 2 pages - "contact.php" (the form [verified as Form URL]) and "contact_thanks.php" (the process script [verified as Redirect URL])
[Form Field Name] and [Display Name] both match exactly in step 4 - Database Setup.
My problem is that the form appears to submit and jumps to the contact_thanks.php page but the variables arn't passed so it doesnt submit to email.
It does write to the database though.
The form works fine without formtools, and I get the email as expected.
I even checked the boxes for "pass on value to redirect page?" for all my form fields but that doesnt help either.
Can anyone see why my code isnt working and please advise what I might need to change? Or is there anything I need to check in the forumtool configuration?
contact.php -
contact_thanks.php -
[Form Field Name] and [Display Name] both match exactly in step 4 - Database Setup.
My problem is that the form appears to submit and jumps to the contact_thanks.php page but the variables arn't passed so it doesnt submit to email.
It does write to the database though.
The form works fine without formtools, and I get the email as expected.
I even checked the boxes for "pass on value to redirect page?" for all my form fields but that doesnt help either.
Can anyone see why my code isnt working and please advise what I might need to change? Or is there anything I need to check in the forumtool configuration?
contact.php -
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>JemCon 2009 :: Contact JemCon</title>
<?php include ('inc/template_header.html');?>
<h1>CONTACT JEMCON</h1>
Do you have a comment, suggestion or question for the <a href="staff.php">JemCon Staff</a> that hasn't been answered in our <a href="faqs.php">JemCon FAQs</a> page?<br><br>
Contact us via the <a href="messageboard.php">JemCon messageboard</a> (you will need to
<a href="messageboard/profile.php?mode=register">register</a> to do this) or the online form below:<br><br><br>
<center>
<form action="http://www.jemcon.org/process_scripts/formtools/process.php" method="post" id="contactform">
<input type="hidden" name="form_tools_form_id" value="3" />
<table border="0" width="100%" cellpadding="0">
<tr>
<td align="right" width="45%"><b>Full Name:</b></td><td align="left" width="55%"> <INPUT TYPE="text" NAME="fullname" SIZE="30"></td></tr>
<tr><td align="right"><b>Email Address:</b></td><td align="left"> <INPUT TYPE="text" NAME="email" SIZE="30"></td></tr>
<tr><td align="right"><b>Subject:</b></td><td align="left"> <INPUT TYPE="text" NAME="subject" SIZE="30"></td></tr>
<tr><td align="right" valign="top"><b>Message:</b></td><td align="left"><TEXTAREA NAME="message" ROWS=5 COLS=30 style="border:1px solid #990099"></TEXTAREA></td></tr>
<tr><td width="100%" align="center" colspan="2">
<INPUT TYPE="submit" value="Submit" style="cursor:pointer; cursor:hand;">
<INPUT TYPE="reset" style="cursor:pointer; cursor:hand;">
</td></tr></table></form>
</center>
<?php include ('inc/template_footer.html');?>
contact_thanks.php -
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>JemCon 2009 :: Contact JemCon</title>
<?php include ('inc/template_header.html');?>
<h1>CONTACT JEMCON</h1>
<center>
<?php
if(empty($fullname) || empty($subject) || empty($email) || empty($message)) {
echo "<h2>Error - You must complete all fields!</h2><br><a href='#' onClick='history.go(-1)'>Return to previous page</a>\n";
}
else {
$from = "From: Admin @ JemCon <admin@jemcon.org>";
$to = "webmaster@jemcon.org";
$subject = "JemCon Contact Form";
$body = "Name: $fullname \nEmail Address: $email \nSubject: $subject \n\nMessage: $message\n";
mail($to,$subject,$body,$from);
echo "<h2>Thank you for contacting us.</h2>\n";
}
?>
</center>
<br><br>
<h1>CONTACT INFORMATION:: Here's what you just sent to us</h1>
<center>
<table border="0" width="100%" cellpadding="0">
<tr>
<td align="right" width="45%"><b>Full Name:</b></td><td align="left" width="55%"><?php echo $_POST['fullname']; ?></td></tr>
<tr><td align="right"><b>Email Address:</b></td><td align="left"><?php echo $_POST['email']; ?></td></tr>
<tr><td align="right"><b>Subject:</b></td><td align="left"><?php echo $_POST['subject']; ?></td></tr>
<tr><td align="right" valign="top"><b>Message:</b></td><td align="left"><?php echo $_POST['message']; ?></td></tr>
<tr><td width="100%" align="center" colspan="2">
</table>
</center>
<br><br>
We will reply to you shortly. In the meantime, if you wish to ask us anything else feel free to contact us again.
<br><br>
<?php include ('inc/template_footer.html');?>