Hello everyone,
I’ve got a little problem with PHP script. When I upload it on server I get info that
Parse error: syntax error, unexpected ‘{’ in /home/b66_07/www/email2/example.php on line 22
, 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:
<?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>";
}
Could anyone help me solve this?