Hi
I hope someone can help.
I have a page which has 2 seperate forms (see link below)
http://www.jasonmillward.com/development/kingstoncabinets/contact-kingston.php
I anm having trouble getting the forms to send the correct information.
I presume I need to use an if statement in the php in the header to send the information related to each form depending on which submit button is clicked but I am having trouble getting it working. This is what i have at the moment and I get teh second form information no matter which form is filled in. Would I need to use the if statement with teh form name or by calling each submit button a different name.
if(isset($_POST['Submit1'])) {
$to = 'jason@jasonmillward.com';
$name = stripslashes($_POST['name']); //sender's name
$number = stripslashes($_POST['number']); //sender's telephone number
$timetocall = stripslashes($_POST['timetocall']); // senders best time to call
$subject = "Callback request from Kingston Cabinets website";
$msg = "Callback request from Kingston Cabinets website \r\n";
$msg .= "From : $name \r\n"; //add sender's name to the message
$msg .= "Telephone Number : $number \r\n"; //add sender's telephone number to the message
$msg .= "Best time to Call : $timetocall \r\n"; //add sender's best time to call to the message
}
else {
$to = 'jason@jasonmillward.com';
$name2 = stripslashes($_POST['name2']); //sender's name
$address = stripslashes($_POST['address']); //sender's telephone number
$address2 = stripslashes($_POST['address2']); // senders best time to call
$postcode = stripslashes($_POST['postcode']); // senders best time to call
//The subject
$subject = "Brochure request from Kingston Cabinets website";
$msg = "Brochure request from Kingston Cabinets website \r\n";
$msg .= "From : $name2 \r\n"; //add sender's name to the message
$msg .= "Address line 1 : $address \r\n"; //add sender's telephone number to the message
$msg .= "Address line 2 : $address2 \r\n"; //add sender's best time to call to the message
$msg .= "Postcode : $postcode \r\n"; //add sender's best time to call to the message
}
Thanks fot your help