Add text to body in phMailer
HI Guys,
i´m new to PHP but i love this phMailer script. My one question after hours of searching the web is how do i add variable outpts to the body of the mail. For example, if i add a new field called $companyname, and i want the message body to start with: From $companyname how do i do this? |
Here is a good tutorial on php and web forms:
http://www.w3schools.com/php/php_forms.asp Read the above brief tutorial and then follow below... As for adding them into the body of the email phMailer sends, you will want to find the line: $message.="$yourmessage"; Basically, create a new line two lines above it and replace $yourmessage with your $_POST information. An example would look like: $message.="Company Name: $_POST['company_name']"; $message.="\n"; $message.="Another field: $_POST['field_name']"; $message.="\n"; $message.="$yourmessage"; Sorry if this is a bad explanation, im not to good at explaining things. |
It can be done other ways but that way is the easiest I know of.
$_POST['company_name']; assumes that you have named the html element company_name. Make sure you only name the element, don`t put ID's on them...that's an error in XHTML. $message.="Company Name: ".$_POST['company_name']; $message.="\n"; $message.="Another field:".$_POST['field_name']; $message.="\n"; $message.="$yourmessage"; |
Quote:
http://www.w3.org/TR/xhtml1/ Read sec 4.10 Quote:
|
XHTML 1.4 does not allow that.
I tried it and it freaked out. It's lameness does not allow iFrames either which is stupid. |
That's extremely odd how they would deprecate the name element for xhtml 1.0 and then deprecate id for 1.4 and bring back name.
I can't comment on the iframe but if ID is going to be taken out i'd like to see some document that states it on w3's website. Not trying to call you out or anything but I can't find anything and i'd like to know where you heard that from. |
I'll find it, I can`t remember what DTD we were using. Let me look into it. I was pretty shocked when I saw it.
|
Quote:
|
I must be halucinating Scott. I swear I was getting "invalid property" when I assigned an ID to an input field. O-well looks like XHTML 1.1 accepts it.
Sorry to mislead. It still doesn`t support iframes though. I think it was because I had the ID in caps. Quote:
|
All times are GMT -5. The time now is 01:23 PM. |
Powered by vBulletin®