You are here: Simple Form Script Not Working After Server Switch « All PHP « IT news, forums, messages
Simple Form Script Not Working After Server Switch

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация