This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > Dreamweaver > August 2005 > Form $message problem...





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Form $message problem...
withhisstripes

2005-08-26, 7:23 pm

Heya,
I am creating a form at www.hookweb.net/testing/form.php but I have a
problem. I want to include the state and country input lines in the message
area in my emails, but it either doesn't appear or appears like on the subject
line or something. I can't figure out how to get them to both appear in the
message area. Also, I need to give tell the form what it's title is, does
anyone know how to do that?

-Thanks spence

Ryan Butler

2005-08-26, 7:23 pm

I'm PHP intermediate but something like this:

<?php
//declare msg variable to concatenate user values. The period after each msg
variable starting in the second line is how you concatenate in PHP. The "\n"
is a character escape sequence in PHP to provide a hard line break. // are
comments. $msg, is the variable. Just copy and paste this code if you wish,
should work.

$msg="Name: " . $_POST['name'] . "\n";
$msg.="Email: " . $_POST['email']. "\n";
$msg.="Country: " $_POST['country']. "\n";
$msg.="State: " $_POST['state']. "\n";

//this personalizes the email, meaning whoever fills it out, it will provide
their email address in the from field in an email client
$headers="From: " . $_POST['email']. "\n";

//this sends the mail. The mail function requires three parameters, the
email address of the specified receipient, a subject, and the message
variable. The headers variable is optional
mail(you@mail.com, "Contact Us", $msg, $headers);

//IF you want the form to redirect to a success page, look up the redirect
function.

//kill the script from executing
die;
?>

Ryan

"withhisstripes" <webforumsuser@macromedia.com> wrote in message
news:deno4g$s4v$1@forums.macromedia.com...
> Heya,
> I am creating a form at www.hookweb.net/testing/form.php but I have a
> problem. I want to include the state and country input lines in the
> message
> area in my emails, but it either doesn't appear or appears like on the
> subject
> line or something. I can't figure out how to get them to both appear in
> the
> message area. Also, I need to give tell the form what it's title is, does
> anyone know how to do that?
>
> -Thanks spence
>



withhisstripes

2005-08-26, 7:23 pm

Hey Ryan,
Thanks for the help, that worked perfectly. Now, another question if you
have the time... This form is being embedded into an email that is sent out, so
I need it to stay on the page that is originally displayed in the email while
still displaying a success page where the form is. Any ideas?
www.hookweb.net/testing/email.htm

Ryan Butler

2005-08-26, 7:23 pm

Not sure I follow. You mean the results from the form are being embedded in
an email? If it is, then you would need to look into how to format that
output through an HTML email and also redirect visitors to a success page.
You have the latter part plus the results, just not the email with the
information they requested (processed from the form) which would be the HTML
email. Again, not sure I follow you, I'll try and remember to look this
thread up tomorrow.

Ryan

"withhisstripes" <webforumsuser@macromedia.com> wrote in message
news:denvnj$9tv$1@forums.macromedia.com...
> Hey Ryan,
> Thanks for the help, that worked perfectly. Now, another question if
> you
> have the time... This form is being embedded into an email that is sent
> out, so
> I need it to stay on the page that is originally displayed in the email
> while
> still displaying a success page where the form is. Any ideas?
> www.hookweb.net/testing/email.htm
>



withhisstripes

2005-08-31, 7:34 pm

Nevermind, I used a different route, thanks though guys!
Sponsored Links


Copyright 2003 - 2008 forum4designers.com  Software forum  Computer Hardware reviews