/    Sign up×
Community /Pin to ProfileBookmark

Need help with "Parse error: syntax error, unexpected ‘{‘ "

Hello everyone,
I’ve got a little problem with PHP script. When I upload it on server I get info that

[quote]

Parse error: syntax error, unexpected ‘{‘ in /home/b66_07/www/email2/example.php on line 22

[/quote]

, as far as I know, there’s a problem with “{” in line with “try{“, but when I remove “{” then everything doesn’t work.

Here’s my PHP code:

[code=php]
<?php
require_once(’email-txt.class.php’);

if($_POST[‘form_sended’]==”1″) {
$ObjEmailTxt = new EmailTxt();
try {
$ObjEmailTxt->LoadFile($_FILES);
}catch(Exception $e){
echo “<span class=error>”;
echo $e->getMessage();
echo “</span><br>”;
}
$ObjEmailTxt->SetSender($_POST[“sender”]);

if(!empty($_POST[“reply_to”])) {
$ObjEmailTxt->SetReplyTo($_POST[“reply_to”]);
}else{
$ObjEmailTxt->SetReplyTo($_POST[“sender”]);
}

$ObjEmailTxt->SetSubject($_POST[“temat”]);

$ObjEmailTxt->SetMsg($_POST[“tresc”]);
try {
$ObjEmailTxt->Send();
}catch(Exception $e) {
echo “<span class=error>”;
echo $e->getMessage();
echo “</span><br>”;
}

echo “znaleziono “.$ObjEmailTxt->ReturnCounter().” adresow email.”;
echo “<br><br>”;
}[/code]

Could anyone help me solve this?

to post a comment
PHP

1 Comments(s)

Copy linkTweet thisAlerts:
@NogDogDec 21.2012 — No parse error when I copy/paste into my editor. Maybe check if you have any extraneous non-printing characters in the actual file?
×

Success!

Help @Pazaak 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 5.19,
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: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

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

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...