Jump to content

[Solved]Emailing form results BUT with some being processed


ajsuk

Recommended Posts

Hey there, I'm having trouble doing what I want to do with emailing some form results.

I know that you can include results as variables with no trouble but the problem comes for me because some of my form results have to be processed with if statements and so on meaning its not always just a direct dump from the form field for example. I'm guessing I need to be using a function or something? I've tried messing with them but I can't seem to get the email message to accept/include anything other than variables and static text.

Any help would be greatly appreciated!

Thanks in advance,

Andy. =)
Well I would of posted something but its all in my head at the moment.
I havn't really a clue what how to do what I want and so havn't got any examples however I'll throw in what little I think is right...

[code]
function agecheck()
  {
if ($age < 21)
echo $age."(Under age)";
else
echo $age;
  }

$to = "[email protected]";
$subject = "Test mail";
$message = "Here are the results: $firstname $lastname of agecheck() years old...";
$from = "[email protected]";
$headers = "From: $from";
mail($to,$subject,$message,$headers);
echo "Mail Sent.";
[code][/code][/code]
why not just parse the information before the mail()?

[code=php:0]
if ($age < 21) {
    $age .= ' (Under age)';
}

$to = "[email protected]";
$subject = "Test mail";
$message = "Here are the results: $firstname $lastname of $age years old...";
$from = "[email protected]";
$headers = "From: $from";
mail($to,$subject,$message,$headers);
echo "Mail Sent.";
[/code]

oh

[quote author=ToonMariner link=topic=121297.msg498371#msg498371 date=1168117532]
Any clues to your actual problem would be even more welcome. A bit of code perhaps? or maybe a prediction as to when it will rain next in Paris? anything, anything at all....
[/quote]

Maybe monday (30% chance)

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.