Jump to content

Archived

This topic is now archived and is closed to further replies.

rstrik

Help embedding a link into an email

Recommended Posts

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.

[code]
$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();
[/code]

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.

Share this post


Link to post
Share on other sites
Change:

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

to

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

Share this post


Link to post
Share on other sites
[!--quoteo(post=383567:date=Jun 13 2006, 08:27 PM:name=poirot)--][div class=\'quotetop\']QUOTE(poirot @ Jun 13 2006, 08:27 PM) [snapback]383567[/snapback][/div][div class=\'quotemain\'][!--quotec--]
Change:

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

to

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

Works perfectly, thanks alot for your help.

Share this post


Link to post
Share on other sites

×

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.