Question regarding using echo to display variables

Well I'm back again with another stupid question...

I am trying to call information from a MySQL database table and fill in areas on a document.

I found a PHP Mail script that will allow me to send an HTML message in the body of the email.

It has a variable like this...

$message= '

PAGE TEXT AREA

';

My question is whether it is possible to fill in variables in the "PAGE TEXT AREA" within the starting and ending ' (single quote) by using the <?php echo "$fieldname"; ?> method. I have tried everything I'm capable of trying with no luck. I can't get the info in the database to show up.

I'm hoping some smart young PHP genius can help. That means YOU Andrew! Of course any Genius can reply!

Thanks in advance.

Ray

By Anonymous on

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Question regarding using echo to display variables

I'm not sure of exactly how you have the scrip setup, but it sounds like you could do something like this:

Old code$message= '

PAGE TEXT AREA

';

to$message = "". $fieldname ."";

fyi the period is the concatenation operator for strings

Stalk me!

Drupal Association Member