Forums

PHP

This topic is locked

PHP form help

Posted 22 Jun 2005 14:28:58
1
has voted
22 Jun 2005 14:28:58 john dibb posted:
Hi All

I am in the process of developing a co reg form in html and php.

I have set up the html and basic php all works fine www.actinic-europe.co.uk/sof...wnloadform.html

But i need to be able to make all the drop down areas validate when each check box has been checked and not if unchecked.

Can this be done?

I also need to send all three areas to four different email address.

Will it work like this :-


<?
$first = $_REQUEST['first'] ;
$last = $_REQUEST['last'] ;
$country = $_REQUEST['country'] ;
$email = $_REQUEST['email'] ;
$address1 = $_REQUEST['address'] ;
$address2 = $_REQUEST['address2'] ;



if (!isset($_REQUEST['first'])) {
header( "Location: www.actinic-europe.co.uk/sof...wnloadform.html" );
}
elseif (empty($first) || empty($last) || empty($country) || empty($email) || empty($address1) || empty($address2)) {
?>

<html>
<head><title>Error</title></head>
<body>
<h1>Error</h1>
<p>
Oops, it appears you forgot to enter either your
email address or your message. Please press the BACK
button in your browser and try again.
</p>
</body>
</html>

<?
}
else {
mail( " ", "Download Form Results",

"$first\n
$last\n
$country\n
$email\n
$address1\n
$address2\n",
"From: $name <$email>" );

mail( " ", "Download Form Results",

"$first\n
$last\n
$country\n
$email\n
$address1\n
$address2\n",
"From: $name <$email>" );

mail( " ", "Download Form Results",

"$first\n
$last\n
$country\n
$email\n
$address1\n
$address2\n",
"From: $name <$email>" );



?>

Thanks in advance for any help or advice

John

Reply to this topic