21 |
|
|
22 |
$sth = $dbh->prepare("select email from emails where referer='$from' limit 1"); |
$sth = $dbh->prepare("select email from emails where referer='$from' limit 1"); |
23 |
$sth->execute(); |
$sth->execute(); |
24 |
$email_to="webmaster@pliva.hr"; |
$email="webmaster@pliva.hr"; |
25 |
if ($row=$sth->fetchrow_hash()) { |
if ($row=$sth->fetchrow_hash()) { |
26 |
$email_to=$row[email]; |
$email=$row[email]; |
27 |
} |
} |
28 |
|
|
29 |
|
$email=str_replace("\n","",$email); |
30 |
|
$email=str_replace(" ","",$email); |
31 |
|
$email_val=explode(",",$email); |
32 |
|
|
33 |
$sth = $dbh->prepare("select iso,name from countries order by name"); |
$sth = $dbh->prepare("select iso,name from countries order by name"); |
34 |
$sth->execute(); |
$sth->execute(); |
35 |
while ($row=$sth->fetchrow_hash()) { |
while ($row=$sth->fetchrow_hash()) { |
36 |
$countries[]=$row; |
$countries[]=$row; |
37 |
} |
} |
38 |
$smarty->assign(array(countries=>$countries, |
$smarty->assign(array(countries=>$countries, |
39 |
email_to=>$email_to, |
email_val=>$email_val, |
40 |
)); |
)); |
41 |
|
|
42 |
include("common.inc"); |
include("common.inc"); |
43 |
$main=$smarty->fetch("$main_file.tpl"); |
|
44 |
|
if (! isset($mailto)) { |
45 |
|
$main=$smarty->fetch("$main_file.tpl"); |
46 |
|
} else { |
47 |
|
$main="Your comment is sent to $mailto. Thank you."; |
48 |
|
include("quoted-printable.inc"); |
49 |
|
iso_mail("$fullname ($country) <$email>",$mailto,$subject,$comment); |
50 |
|
# $main.="<pre>$mailto $fullname $email $country $subject $comment</pre>"; |
51 |
|
} |
52 |
|
|
53 |
$smarty->assign( array(MAIN=>$main, from=>$from, |
$smarty->assign( array(MAIN=>$main, from=>$from, |
54 |
contact_section=>1, |
contact_section=>1, |