17 |
|
|
18 |
$smarty->assign( array ( lpic=>$lpic, lext=>$lext, mpic=>$mpic, Section_title=>$title ) ); |
$smarty->assign( array ( lpic=>$lpic, lext=>$lext, mpic=>$mpic, Section_title=>$title ) ); |
19 |
|
|
20 |
$from=str_replace(".php","",basename($HTTP_REFERER)); |
if (! isset($from) || $from == "") { |
21 |
if (strstr($from,"?")) $from=substr($from,0,strpos($from,"?")); |
$from=str_replace(".php","",basename($HTTP_REFERER)); |
22 |
|
if (strstr($from,"?")) $from=substr($from,0,strpos($from,"?")); |
23 |
|
if ($from == $HTTP_HOST) $from="index"; |
24 |
|
} |
25 |
|
|
26 |
|
$email="webmaster@pliva.hr"; // default |
27 |
|
|
28 |
$sth = $dbh->prepare("select email from emails where referer='$from' limit 1"); |
$sth = $dbh->prepare("select email from emails where referer='$from' limit 1"); |
29 |
$sth->execute(); |
$sth->execute(); |
|
$email="webmaster@pliva.hr"; |
|
30 |
if ($row=$sth->fetchrow_hash()) { |
if ($row=$sth->fetchrow_hash()) { |
31 |
$email=$row[email]; |
$email=$row[email]; |
32 |
|
} else { |
33 |
|
$sth = $dbh->prepare("select email from emails,menu where menu.section=referer and url like '$from%'"); |
34 |
|
$sth->execute(); |
35 |
|
if ($row=$sth->fetchrow_hash()) { |
36 |
|
$email=$row[email]; |
37 |
|
} |
38 |
} |
} |
39 |
|
|
40 |
$email=str_replace("\n","",$email); |
$email=str_replace("\n","",$email); |
52 |
|
|
53 |
include("common.inc"); |
include("common.inc"); |
54 |
|
|
55 |
if (! isset($mailto)) { |
if (isset($mailto) && check_required()) { |
|
$main=$smarty->fetch("$main_file.tpl"); |
|
|
} else { |
|
56 |
$main="Your comment is sent to $mailto. Thank you."; |
$main="Your comment is sent to $mailto. Thank you."; |
57 |
include("quoted-printable.inc"); |
include("quoted-printable.inc"); |
58 |
iso_mail("$fullname ($country) <$mailfrom>",$mailto,$subject,$comment); |
iso_mail("$fullname ($country) <$mailfrom>",$mailto,$subject,$comment); |
59 |
# $main.="<pre>$mailto $fullname $mailfrom $country $subject $comment</pre>"; |
# $main.="<pre>$mailto $fullname $mailfrom $country $subject $comment</pre>"; |
60 |
|
} else { |
61 |
|
$main=$smarty->fetch("$main_file.tpl"); |
62 |
} |
} |
63 |
|
|
64 |
$smarty->assign( array(MAIN=>$main, from=>$from, |
$smarty->assign( array(MAIN=>$main, from=>$from, |