PDA

View Full Version : simple form problem


mattcarless
12-14-2003, 07:00 AM
I'm having difficulty getting a simple form (name, email, message) to deliver the entered details to my email. If you go to http://freespace.virgin.net/am.carless and click on the contact button you can see the form in question. I have got the following php on the send button.

PHP:
------------------------------------------------------------------------
<?php

while(list($Key,_$Val)=_each($HTTP_POST_VARS))
____$resp.="$Key_:_$Val\n";
mail("am.carless@virgin.net",_"Form submission on web site",_$resp);

header("Location: thanks.html");
?>
------------------------------------------------------------------------


Does anybody have any idea why this won't work? It is simpler just to have a mailto action that brings up an email window, but I wanted the form because it looks slicker..........help!

snapple
12-17-2003, 07:03 PM
Why dont you just use:

(make sure you name it mailer.php)


<?
$mailTo = "you@yourmail.com";
$senderName = "Sent by: $senderName";
$mailSubject = "$messageTitle";
$mailMessage = "The message is: $message";
$mailFrom = "The mail is from: $senderEmail";

mail($mailTo, $mailSubject, $senderName, $mailMessage, $mailFrom);

print "&result=Okay&response=$response&";
?>


This will, of course, require the text fields:

1)senderName
2)senderEmail
3)messageTitle
4)message

on your button in your flash movie, have:

(this is just field checking - nothing too taxing)

on(release)
{
if (senderName != "" || subjectTitle !="" || senderEmail != "" || message != "")
{
loadVariables("mailer.php", this, "POST");
status = "sending mail..."
gotoAndPlay("sending");
}
else
{
status = "all fields required";
gotoAndStop("all fields");
}
}


snapple