GaF Posted January 22, 2007 Share Posted January 22, 2007 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 Link to comment https://forums.phpfreaks.com/topic/35283-using-a-variable-as-an-e-mail-address-in-the-mailto-command/ Share on other sites More sharing options...
genericnumber1 Posted January 22, 2007 Share Posted January 22, 2007 it's not super clear but I think I know what you're getting atyou 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 Link to comment https://forums.phpfreaks.com/topic/35283-using-a-variable-as-an-e-mail-address-in-the-mailto-command/#findComment-166779 Share on other sites More sharing options...
GaF Posted January 23, 2007 Author Share Posted January 23, 2007 Amazing - thank you so much- really appreciate your help.Worked a treat. Link to comment https://forums.phpfreaks.com/topic/35283-using-a-variable-as-an-e-mail-address-in-the-mailto-command/#findComment-166832 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.