|
Posted by nomorespameventhoughthejapanesespamgivesmeachuckle on 12/01/06 04:48
I have a website with a php contact form.
In the html I use <form method="post" action="contact.php">
Then my contact.php looks like this:
<?php
$message = false;
$subject = 'Contact Form';
$email_to = '...@abc.com';
$email_from = $_POST['email'];
$message .= 'A client would like to contact you, their information
is: ' . "\n\r";
$message .= 'The clients first name is: ' . $_POST['firstName'] .
"\n\r";
$message .= 'The clients last name is: ' . $_POST['lastName'] .
"\n\r";
$message .= 'The clients phone# is: ' . $_POST['phoneNumber'] .
"\n\r";
$message .= 'Does the client want you to call them: ' .
$_POST['permissionToCall'] . "\n\r";
$message .= 'The clients email is: ' . $_POST['email'] . "\n\r";
$message .= 'The client is interested in: ' .
$_POST['identity'] . "\n\r";
$message .= 'The client leaves this message: ' .
$_POST['message'] . "\n\r";
if (!isset($_REQUEST['firstName'])) {
header( "Location:
http://www.abc.com/index.php?action=page_display&PageID=2" );
}
elseif (empty($firstName) || empty($lastName) || empty($email)) {
header( "Location:
http://www.abc.com/index.php?action=page_display&PageID=43" );
}
else {
mail( $email_to, $subject, $message, "From: $email_from");
header( "Location:
http://www.abc.com/index.php?action=page_display&PageID=44");
}
?>
When I try to test the form action, I constantly get the pageID=43
which is the error page that says all the required fields have not been
filled out.
Could this be a safe_mode thing because I know that is enabled
server-wide.
I currently don't know any php, just how to put something together and
customize it. I will be learning in the future though so if you have
any suggestions (aka if my method is not a good method) I'd like to
hear suggestions.
Navigation:
[Reply to this message]
|