Jump to content

Using a variable as an e-mail address in the mailto command


GaF

Recommended Posts

Hi,

I am working on a webpage that will send form data to a user selected e-mail address from a drop-down list.

Is there any way to insert the stored value into the mailto command?

The variable storing the e-mail address is $repcopy as per the example below.

$mailto = '$repcopy,[email protected],[email protected]' ;

I am finding that it is not recognising the $repcopy value.

Can anyone please help?

Sorry if this in unclear- I have been doing this for about 2 weeks.

Thanks

it's not super clear but I think I know what you're getting at

you would want to do...

[code=php:0]
$mailto = $repcopy . ',[email protected],[email protected]' ;
[/code]

or...

[code=php:0]
$mailto = "$repcopy,[email protected],[email protected]" ;
[/code]

php doesn't replace variable inside of single quotes, only double... which is why single quotes are a tiny bit faster

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.