/    Sign up×
Community /Pin to ProfileBookmark

Syntax error, unexpected "

Folks,

Do you spot any logical errors in my script ?
I have not given the full script but the SendMail part where I am encountering problem.

I get error:
Parse error: syntax error, unexpected ‘”‘ in /home/…… on line 155.

Line 155 is the line before the <html> tag. That line shows this:
$body = “$first_name.” “.$surname ?>,

Look at the 5th line from the following code. That is where the error occurs:

[code=php]
$account_name = “$username”;
//Step 3C. Email user their account activation link for them to click to confirm their Email Address and activate their new Account.
$to = “$primary_website_email”;
$subject = “Your Following Browser account activation details!”;
$body = “$first_name.” “.$surname ?>,
<html>
<head>
<title>Activation Link</title>
</head>
<body>
Thank you for joining us!<br>
You need to click on the following link <a href=”<?php .$account_activation_link.”>$account_activation_link?></a> to activate your account.
</body>
</html>”;
<?php $headers = “From: $site_admin_email”;
//More headers
//Always set content-type when sending HTML email
$headers = “MIME-Version: 1.0” . “rn”;
$headers .= “Content-type:text/html;charset=UTF-9” . “rn”;

if (!mail($to,$subject,$body,$headers))
{
//Alert user System Error. System unable to email the Account Activation Link.
echo “Sorry! We have failed to email you your account activation details. Please contact the website administrator!”;
exit();
}
else
{
//Alert user System Success. System was able to email the Account Activation Link.
echo “<h3 style=’text-align:center’>Thank you for your registration!</h3><br>”;
echo “Now, check your email “$primary_website_email” for details on how to activate your new account “$account_name” which you just registered.”;
exit();
}
[/code]

to post a comment
PHP

6 Comments(s)

Copy linkTweet thisAlerts:
@ginerjmDec 17.2017 — Maybe you need to look at the line again.

How about simply:
<i>
</i>$body = "$var1 $var2";
Copy linkTweet thisAlerts:
@site-developerauthorDec 17.2017 — Maybe you need to look at the line again.

How about simply:
<i>
</i>$body = "$var1 $var2";
[/QUOTE]


It is like this:

$body = "$first_name." ".$surname ?>,

The dbl quote prior to $first_name represents the opening dbl quote for the variable $body.

The 2 dbl quotes in between

$first_name.

.$surname

represent a space. (Space inbetween first & surname).

So, $firstname, concatenator, 2 dbl quotes representing the space, concatenator, $surname.

The closing dbl quote for the $body variable is right after the closing html tag (few lines below the $body variable).

I hope that is clear.
Copy linkTweet thisAlerts:
@site-developerauthorDec 17.2017 — Maybe you need to look at the line again.

How about simply:
<i>
</i>$body = "$var1 $var2";
[/QUOTE]


Thank you man! I did not understand your hint that you do not concatenate inside dbl quotes but sngl quotes only. Another forum pointed this out and coming back to your post I realize you pointed this out to me all along but I was not clever enough to realize it.

Pitty, this forum does not allow us to give REPs/THANK YOUs/POINTs/SCORES.
Copy linkTweet thisAlerts:
@site-developerauthorDec 17.2017 — Thank you man Ginerjm!

I did not understand your hint that you do not concatenate inside dbl quotes but sngl quotes only. Another forum pointed this out and coming back to your post I realize you pointed this out to me all along but I was not clever enough to realize it.

Pitty, this forum does not allow us to give REPs/THANK YOUs/POINTs/SCORES.
Copy linkTweet thisAlerts:
@ginerjmDec 18.2017 — Thankfully (for you) you managed to realize the fact that I gave you the answer you sought before I read your first response. Otherwise I would have had my way with you in words you probably wouldn't have liked.

HTH!
Copy linkTweet thisAlerts:
@site-developerauthorDec 18.2017 — Thankfully (for you) you managed to realize the fact that I gave you the answer you sought before I read your first response. Otherwise I would have had my way with you in words you probably wouldn't have liked.

HTH![/QUOTE]


Ha! Lol! And that would have been my Christ,mas Gift from you, RIGHT ?

Reserve the words, you will soon gete a chance to use them. Just don't regret for saying them later. Or better, don't use them. ?

Let us build a php searing game! Good idea! I will have this at the back of my head. if I come-up with any then I can add it to my future Social Network (SN). Best to write the game's history. How it was born (this thread). Lol! Seriously! ?
×

Success!

Help @site-developer spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...