Eddie_E
07-16-2008, 03:22 AM
Hi im trying to use PHP with flash for my contact form. I retrieved a script from macromedia which works fine but I need to add a name field to this. Ive tried the obvious additions but because I know little about PHP it looks like ive done something wrong, (all the new fields ive added have a 'fullname' to it.)
<?php
// read the variables form the string, (this is not needed with some servers).
$fullname = $_REQUEST["fullname"];
$subject = $_REQUEST["subject"];
$message = $_REQUEST["message"];
$sender = $_REQUEST["sender"];
// include sender IP in the message.
$full_message = $_SERVER['REMOTE_ADDR'] . "\n\n" . $message;
$message= $full_message;
// remove the backslashes that normally appears when entering " or '
$fullname = stripslashes($fullname);
$message = stripslashes($message);
$subject = stripslashes($subject);
$sender = stripslashes($sender);
// add a prefix in the subject line so that you know the email was sent by online form
$subject = "Contact form ". $subject;
// send the email, make sure you replace email@yourserver.com with your email address
if(isset($message) and isset($fullname) and isset($subject) and isset($sender)){
mail("hiphopbiter@hotmail.com", $subject, $message, $fullname, "From: $sender");
}
?>
Can anyone see whats wrong with this?
thx
Eddie
<?php
// read the variables form the string, (this is not needed with some servers).
$fullname = $_REQUEST["fullname"];
$subject = $_REQUEST["subject"];
$message = $_REQUEST["message"];
$sender = $_REQUEST["sender"];
// include sender IP in the message.
$full_message = $_SERVER['REMOTE_ADDR'] . "\n\n" . $message;
$message= $full_message;
// remove the backslashes that normally appears when entering " or '
$fullname = stripslashes($fullname);
$message = stripslashes($message);
$subject = stripslashes($subject);
$sender = stripslashes($sender);
// add a prefix in the subject line so that you know the email was sent by online form
$subject = "Contact form ". $subject;
// send the email, make sure you replace email@yourserver.com with your email address
if(isset($message) and isset($fullname) and isset($subject) and isset($sender)){
mail("hiphopbiter@hotmail.com", $subject, $message, $fullname, "From: $sender");
}
?>
Can anyone see whats wrong with this?
thx
Eddie