PDA

View Full Version : Email form problem


dipsb_13
12-16-2005, 05:39 PM
hey guys

I have a problem which needs urgent attention

I have made a contact form in Flash using a PHP script I have the fields as follows:

Name
Email
location
URL
message

everything works fine however the "message" field is does not appear in the body of the recieved email

help me please I'm begging you...here is the PHP code used:

<?php
$sendTo = "dips@designreel.com";
$subject = "guestbook entry from laurenelisemodel.com";
$headers = "From: " . $_POST["guestname"];
$headers .= "<" . $_POST["guestemail"] . ">\r\n";
$headers .= "Reply-To: " . $_POST["guestemail"] . "\r\n";
$headers .= "Return-Path: " . $_POST["guestemail"];
$message = $_POST["guestmessage"]. \"r\n";
$message = $_POST["guestlocation"]. \"r\n";
$message .= $_POST["guesturl"];
mail($sendTo, $subject, $message, $headers);
?>

Everything else works fine - please note that the var name for the message field is "guestmessage"

Please help me somebody

Dips

Flash Gordon
12-16-2005, 05:42 PM
Sigh........
<?php

$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= 'From: ' . $_POST['name'] . '<' . $_POST['email'] . '>' . "\r\n";

$message = stripslashes($_POST['message']) .
"<br>Your IP address is: " .$_SERVER['HTTP_CLIENT_IP'] . $_SERVER['REMOTE_ADDR'] .
"<br>The browser you are using is: " . $_SERVER['HTTP_USER_AGENT'] .
"<br>The date and time is: " . date("l F j Y g:i a");

if ($_POST['subject'] !="" && $_POST['email'] !="" && $_POST['message'] !="" &&$_POST['key'] == ******) {
$ok = mail("me@aa.com", $_POST['subject'], $message, $headers );
//$ok = mail("me@aa.com", stripslashes($_POST['subject']), $message, $headers );
if ($ok) {
echo "&echo=success&";
} else {
echo "&echo=failed&";
}
}
?>

set the headers and add <br>
Flash please help

I've got a contact form however when the user clicks send I recieve all the fields in the email I recieve bar one:

heres the PHP code I'm using:


<?php
$sendTo = "dips@designreel.com";
$subject = "guestbook entry from laurenelisemodel.com";
$headers = "From: " . $_POST["guestname"];
$headers .= "<" . $_POST["guestemail"] . ">\r\n";
$headers .= "Reply-To: " . $_POST["guestemail"] . "\r\n";
$headers .= "Return-Path: " . $_POST["guestemail"];
$message = $_POST["guestmessage"].
$message = $_POST["guestlocation"].
$message .= $_POST["guesturl"];
mail($sendTo, $subject, $message, $headers);
?>


If I delete the location from the above then both url and message will be in the body of the email however with message, location and url left (i.e. as the code is above then the message will not display in the body of the email!

ARGH please help me Flash

Dips

Flash Gordon
12-16-2005, 05:44 PM
everything works fine however the "message" field is does not appear in the body of the recieved email THere is nothing wrong with your script, it has to be a deeper issue than that.

you really ought to change the title of you thread. Not is is goingto search for "URGENT HELP ME" if look to write and email script :(

Flash Gordon
12-16-2005, 06:29 PM
GOT IT!


you forgot the concentrator .=


HA! helps when i have my glasses on :)

dipsb_13
12-16-2005, 06:52 PM
hahaha cheers Flash

thats hillarious - literally just worked that out before reading your post

I noticed that too....something so small has never stressed me out so much!

it was driving me insane

thanks anyway if only we had worked it out sooner - i won't forget that in a hurry

Dips