This topic is locked

Syntax HELP

8/11/2008 3:24:07 PM
PHPRunner General questions
L
Lisa2006 author

Hi All,
I need help with the following problem.
I've set up an email routine as follows:

;

$subject = 'Journey Submitted';

$emailBody = chunk_split(base64_encode("<html>\n"

...

...

. " <tr> \n"

. " <td width=\"152\" class=\"leftstyle\">&nbsp;Map View</td>\n"

. " <td width=\"480\" colspan=\"5\" class=\"rightstyle\">&nbsp;<a href=\"http://maps.google.co.uk/maps?saddr=$starttown%2C$startpostcode&daddr=$endtown%2C$endpostcode\"'>http://maps.google.co.uk/maps?saddr=$starttown%2C$startpostcode&daddr=$endtown%2C$endpostcode\"; target=\"blank\">Click Here</a></td>\n"

. " </tr>\n"

...

...

$displayname = "ABC Company";

$emailHeader = "From: ".$displayname." <"."joebloggs@myemail.co.uk".">\n"

. "MIME-Version: 1.0\n"

. "Content-Type: text/html; charset=\"ISO-8859-1\"\n"

. "Content-Transfer-Encoding: base64\n"

. "\n";

mail($to, $subject, $emailBody, $emailHeader);
When executed all works 100%.
Here's the problem:_

I have several versions of the code, of which will be assigned to a session variable based on IF conditions:
I need a way of being able to assign this code via the use of session variables to the original email script.
i.e.
$_session["googlemap"] = "<td width=\"480\" colspan=\"5\" class=\"rightstyle\">&nbsp;<a href=\"http://maps.google.co.uk/maps?saddr=$starttown%2C$startpostcode&daddr=$endtown%2C$endpostcode\"'>http://maps.google.co.uk/maps?saddr=$starttown%2C$startpostcode&daddr=$endtown%2C$endpostcode\"; target=\"_blank\">Click Here</a></td>\n";
then i need to place this session variable [color=#000080]$_session["googlemap"] back into the email script
i.e.

;

$subject = 'Journey Submitted';

$emailBody = chunk_split(base64_encode("<html>\n"

.

.

. " <tr> \n"

. " <td width=\"152\" class=\"leftstyle\">&nbsp;Map View</td>\n"
[color=#000080]. " </tr>\n"

.

.

$displayname = "ABC Company";

$emailHeader = "From: ".$displayname." <"."joebloggs@myemail.co.uk".">\n"

. "MIME-Version: 1.0\n"

. "Content-Type: text/html; charset=\"ISO-8859-1\"\n"

. "Content-Transfer-Encoding: base64\n"

. "\n";

mail($to, $subject, $emailBody, $emailHeader);
My problem is that i do not know how to write the appropriate syntax. Your help and support would be much appreciated.
Lisa

L
Lisa2006 author 8/12/2008

Hi Forum,
I've now managed to solve the problem.
Thank in advance
Lisa