Jump to content

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.
Link to comment
https://forums.phpfreaks.com/topic/11940-help-embedding-a-link-into-an-email/
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.
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.