I am using a contact form constructed with Swishmax. The code to send the data to contact.php is:
function Events(n,v) {
// handle events from clear and enter button.
switch(n) {
case "Button_Enter":
// check that user data looks ok.
var formerror:Boolean = false;
TickAnimated.Hide();
EntryForm.ResetWarnings(); // clear the warning flags
// first name - require at least 1 char.
formerror |= EntryForm.CheckMinLength(1,1);
// surname - require at least 2 chars
formerror |= EntryForm.CheckMinLength(2,2);
// check valid email address
formerror |= EntryForm.CheckValidEmail(3);
if (!formerror) {
myurl = "http://www.metamedia.gb.com/contact.php";
myurl = myurl add "?firstname=" add EntryForm.GetItem(1);
myurl = myurl add "&lastname=" add EntryForm.GetItem(2);
myurl = myurl add "&email=" add EntryForm.GetItem(3);
// open the URL
getURL(myurl,"_blank");
// all OK. Show the tick of approval.
TickAnimated.Show();
}
break;
case "Button_Clear":
// clear the form and the tick
TickAnimated.Hide();
EntryForm.ClearForm();
break;
}
}
This generates a link:
http://www.metamedia.gb.com/contact.php?firstame=Bill&lastname=Smith&email=bill@smith.co.uk
This sends the email but all that is in it is:
First Name:
Last Name:
E-Mail:
The contact.php is:
<?php
$firstname = $_POST['firstame'];
$lastname = $_POST['lastame'];
$email = $_POST['email'];
$sendTo = "myemail@myemail.co.uk";
$subject = "Newsletter";
$msg_body .= "First Name: $firstname\n";
$msg_body .= "Last Name: $lastname\n";
$msg_body .= "E-Mail: $email\n";
$header_info = "From: ".$firstname." <".$email.">";
mail($sendTo, $subject, $msg_body, $header_info);
echo "Thank you for signing up to our newsletter.\n";
echo "You can now close this window.\n";
?>
Can anyone see why the data is not being added to the email?
Keith