Hunkorama417
10-01-2000, 09:18 PM
My web site is http://www.fbhm.com. If you visit the contact page http://www.fbhm.com/contact.html (PHP page) and don't fill out the form, but press submit it asks you to include a subject. It should however ask you to fill out a name, then an e-mail address, then a subject, and then a message; however, it skips the name and e-mail address while validating the form. Also, when I filled out the form with the following values the from address which should be the value of the e-mail field arrived in my inbox with the address test@test.com.
Name: testName (doesn't validate)
Email: test (should validate for valid e-mail)
Subject: testSubject
Message: testMessage
My PHP code is as follows:
<?php
$recipient = "info@fbhm.com";
function errorHTML ($msg) {
[nbsp][nbsp][nbsp][nbsp]echo "<table width=425 border=0 align=center cellpadding=2 cellspacing=2>\n";
[nbsp][nbsp][nbsp][nbsp]echo "<tr>\n";
[nbsp][nbsp][nbsp][nbsp]echo "<td>\n";
[nbsp][nbsp][nbsp][nbsp]echo "<span class=header>Error!</span>
\n";
[nbsp][nbsp][nbsp][nbsp]echo $msg . "\n";
[nbsp][nbsp][nbsp][nbsp]echo "</td>\n";
[nbsp][nbsp][nbsp][nbsp]echo "</tr>\n";
[nbsp][nbsp][nbsp][nbsp]echo "</table>\n";
[nbsp][nbsp][nbsp][nbsp]echo "
\n";
}
function thanksHTML ($msg) {
[nbsp][nbsp][nbsp][nbsp]echo "<table width=425 border=0 align=center cellpadding=2 cellspacing=2>\n";
[nbsp][nbsp][nbsp][nbsp]echo "<tr>\n";
[nbsp][nbsp][nbsp][nbsp]echo "<td>\n";
[nbsp][nbsp][nbsp][nbsp]echo "<span class=header>Thanks!</span>
\n";
[nbsp][nbsp][nbsp][nbsp]echo $msg . "\n";
[nbsp][nbsp][nbsp][nbsp]echo "</td>\n";
[nbsp][nbsp][nbsp][nbsp]echo "</tr>\n";
[nbsp][nbsp][nbsp][nbsp]echo "</table>\n";
[nbsp][nbsp][nbsp][nbsp]echo "
\n";
}
if ($submit) {
[nbsp][nbsp][nbsp][nbsp]if ($name == "")
[nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp]errorHTML ("You must include a name. Please go <a href=javascript:window.history.go(-1);>back</a> and fill out this information then re-submit the form again.");
[nbsp][nbsp][nbsp][nbsp]else if (!ereg ('^[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+'.'@'.'[-!#$%&\'*+\\/0-9=?A-Z^_`a-z{|}~]+\.'.'[-!#$%&\'*+\\./0--9=?A-Z^_`a-z{|}~]+$', $email))
[nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp]errorHTML ("You must include a valid e-mail address. Please go <a href=javascript:window.history.go(-1);>back</a> and fill out this information then re-submit the form again.");
[nbsp][nbsp][nbsp][nbsp]else if ($subject == "")
[nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp]errorHTML ("You must include a subject. Please go <a href=javascript:window.history.go(-1);>back</a> and fill out this information then re-submit the form again.");
[nbsp][nbsp][nbsp][nbsp]else if ($message == "")
[nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp]errorHTML ("You must include a message. Please go <a href=javascript:window.history.go(-1);>back</a> and fill out this information then re-submit the form again.");
[nbsp][nbsp][nbsp][nbsp]else {
[nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp]if (@mail ("$recipient", "$subject", "$message", "From: $email\r\nReply-to: $email\r\n"))
[nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp]thanksHTML ("Your message has been sent and we look forward to receiving it.");
[nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp]else
[nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp]errorHTML ("Your message wasn't sent for various reasons. Please go <a href=javascript:window.history.go(-1);>back</a> and try again");
[nbsp][nbsp][nbsp][nbsp]}
}
else {
?>
FORM GOES HERE
<?php } ?>
The strange thing about all of this was it was working a couple weeks ago and all of a sudden it doesn't. So I'm inclined to believe this to be an error with FutureQuest's PHP configuration. Please help!!<!-- NO_AUTO_LINK -->
------------------
Andrew
www.digi-FX.net (http://www.digi-FX.net)
Name: testName (doesn't validate)
Email: test (should validate for valid e-mail)
Subject: testSubject
Message: testMessage
My PHP code is as follows:
<?php
$recipient = "info@fbhm.com";
function errorHTML ($msg) {
[nbsp][nbsp][nbsp][nbsp]echo "<table width=425 border=0 align=center cellpadding=2 cellspacing=2>\n";
[nbsp][nbsp][nbsp][nbsp]echo "<tr>\n";
[nbsp][nbsp][nbsp][nbsp]echo "<td>\n";
[nbsp][nbsp][nbsp][nbsp]echo "<span class=header>Error!</span>
\n";
[nbsp][nbsp][nbsp][nbsp]echo $msg . "\n";
[nbsp][nbsp][nbsp][nbsp]echo "</td>\n";
[nbsp][nbsp][nbsp][nbsp]echo "</tr>\n";
[nbsp][nbsp][nbsp][nbsp]echo "</table>\n";
[nbsp][nbsp][nbsp][nbsp]echo "
\n";
}
function thanksHTML ($msg) {
[nbsp][nbsp][nbsp][nbsp]echo "<table width=425 border=0 align=center cellpadding=2 cellspacing=2>\n";
[nbsp][nbsp][nbsp][nbsp]echo "<tr>\n";
[nbsp][nbsp][nbsp][nbsp]echo "<td>\n";
[nbsp][nbsp][nbsp][nbsp]echo "<span class=header>Thanks!</span>
\n";
[nbsp][nbsp][nbsp][nbsp]echo $msg . "\n";
[nbsp][nbsp][nbsp][nbsp]echo "</td>\n";
[nbsp][nbsp][nbsp][nbsp]echo "</tr>\n";
[nbsp][nbsp][nbsp][nbsp]echo "</table>\n";
[nbsp][nbsp][nbsp][nbsp]echo "
\n";
}
if ($submit) {
[nbsp][nbsp][nbsp][nbsp]if ($name == "")
[nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp]errorHTML ("You must include a name. Please go <a href=javascript:window.history.go(-1);>back</a> and fill out this information then re-submit the form again.");
[nbsp][nbsp][nbsp][nbsp]else if (!ereg ('^[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+'.'@'.'[-!#$%&\'*+\\/0-9=?A-Z^_`a-z{|}~]+\.'.'[-!#$%&\'*+\\./0--9=?A-Z^_`a-z{|}~]+$', $email))
[nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp]errorHTML ("You must include a valid e-mail address. Please go <a href=javascript:window.history.go(-1);>back</a> and fill out this information then re-submit the form again.");
[nbsp][nbsp][nbsp][nbsp]else if ($subject == "")
[nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp]errorHTML ("You must include a subject. Please go <a href=javascript:window.history.go(-1);>back</a> and fill out this information then re-submit the form again.");
[nbsp][nbsp][nbsp][nbsp]else if ($message == "")
[nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp]errorHTML ("You must include a message. Please go <a href=javascript:window.history.go(-1);>back</a> and fill out this information then re-submit the form again.");
[nbsp][nbsp][nbsp][nbsp]else {
[nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp]if (@mail ("$recipient", "$subject", "$message", "From: $email\r\nReply-to: $email\r\n"))
[nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp]thanksHTML ("Your message has been sent and we look forward to receiving it.");
[nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp]else
[nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp]errorHTML ("Your message wasn't sent for various reasons. Please go <a href=javascript:window.history.go(-1);>back</a> and try again");
[nbsp][nbsp][nbsp][nbsp]}
}
else {
?>
FORM GOES HERE
<?php } ?>
The strange thing about all of this was it was working a couple weeks ago and all of a sudden it doesn't. So I'm inclined to believe this to be an error with FutureQuest's PHP configuration. Please help!!<!-- NO_AUTO_LINK -->
------------------
Andrew
www.digi-FX.net (http://www.digi-FX.net)