Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- PHP feedback form help - newb
- Paul Gunson
February 13, 2004, 11:18 pm
rate this thread
tutorial, using sendmail.php.
my sendmail.php below basically sends a form of two selection boxes and
a textarea for additional comments. it sends me mail ok but the order of
the information as it appears in the e-mail seems to be random... eg,
how do i get select1 to appear first, then select 2, then a line break
and the textbox last...? the current layout makes select2 appear first,
then the textbox, line break, and select1 last. i've tried other layouts
but they either don't send the textbox or result in an error....
$select1 = $_REQUEST['select1'];
$select2 = $_REQUEST['select2'];
$textbox = $_REQUEST['textbox'];
mail( "email@example.com", "Online survey",
"$textbox\n Site looks: $select1", "Connection speed: $select2" );
header( "Location: /thankyou.html" );
any help for an html ignoramus greatly apprec.
Re: PHP feedback form help - newb
Here's your mail statement (more readable):
"$textbox\n Site looks: $select1",
"Connection speed: $select2" );
You want to compose the message body with the three variables so first
."Site looks: ".$select1
."\nConnection speed: ".$select2
The dot is a string concatenator, variables don't need to be quoted,
notice the commas below and semicolon at the end of each statement. I
think the newline "\n" is a string.
Then, I think the format is:
If you have errors, you can do:
$mailerror = mail(as shown above)
to debug it.
The manual in this case is not very helpful, it's usually much much more
clear. If you scroll down, there are good examples though.
- » how can i make radio buttons bolder when printing?
- — Previous thread in » HTML Markup Language