Hi, im new to PHP programming and ive tried a few forums on the net with this question and so far no answers.

I have a php form that is working fine with a pre-determined email address, part of the code is as follows:


I also have a variable that displays fine on the page: (shows an email address passed via previous page)

    <?php echo $_GET['ID']; ?>

So what i am trying to do is combine the two so that it would use the 'ID' as the <name@website.com>. Something like:

    $data_email_sender->AddToAddr("name<?php echo $_GET['ID']; ?>");

I know this is incorrect, but it shows what i am trying to do. Ive tried various ways and so far no success!

Hope someone on daniweb can help. Thanks in advance!

$data_email_sender->AddToAddr("name<" .$_GET['ID']. ">");

You don't need to echo the GET var as you are already in a PHP block.
Or for tidiness, you can build the string separately -

$str = "name<";
$str.= $_GET['id'];
$str.= ">";

Hope this helps.