Jump to content


Photo

Help embedding a link into an email


  • Please log in to reply
2 replies to this topic

#1 rstrik

rstrik
  • Members
  • Pip
  • Newbie
  • 9 posts

Posted 14 June 2006 - 01:23 AM

Hello,

I'm trying to embed a link in a form I'm creating but keep getting an error message that says:

Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in C:\web\lostpw.php on line 61

Here is the code portion I'm using: I'm not including the entire document, don't think it's relevant to my error.

$mailer->Message = "Dear $first_name,\n\n".
"You have requested a new password for My PHP Site. ".
"Below is your new login information:\n\n".
"==========================\n".
"Username: $username\n".
"New Password: $newpass\n".
"==========================\n\n".
"You may login at any time ".
"at http://$_SERVER['SERVER_NAME']/login.php\n\n}".
"Thank You!\n".
"My PHP Site Administrator";
$mailer->SendMail();

Line 62 error is pointing to the "at http://$SERVER['SERVER_NAME']/login.php\n\n"
Is there a better way to write this line? I'm using a book to help me and I think it may be wrong. Thanks for your help.


#2 poirot

poirot
  • Members
  • PipPipPip
  • Advanced Member
  • 646 posts
  • LocationAustin, TX

Posted 14 June 2006 - 01:27 AM

Change:

"at http://$_SERVER['SERVER_NAME']/login.php\n\n}".

to

"at http://{$_SERVER['SERVER_NAME']}/login.php\n\n}".

~ D Kuang

#3 rstrik

rstrik
  • Members
  • Pip
  • Newbie
  • 9 posts

Posted 14 June 2006 - 01:40 AM

[!--quoteo(post=383567:date=Jun 13 2006, 08:27 PM:name=poirot)--][div class=\'quotetop\']QUOTE(poirot @ Jun 13 2006, 08:27 PM) View Post[/div][div class=\'quotemain\'][!--quotec--]
Change:

"at http://$_SERVER['SERVER_NAME']/login.php\n\n}".

to

"at http://{$_SERVER['SERVER_NAME']}/login.php\n\n}".
[/quote]

Works perfectly, thanks alot for your help.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users