--- contact.php 2001/03/02 07:50:38 1.3 +++ contact.php 2001/03/05 11:56:10 1.4 @@ -21,22 +21,34 @@ $sth = $dbh->prepare("select email from emails where referer='$from' limit 1"); $sth->execute(); -$email_to="webmaster@pliva.hr"; +$email="webmaster@pliva.hr"; if ($row=$sth->fetchrow_hash()) { - $email_to=$row[email]; + $email=$row[email]; } +$email=str_replace("\n","",$email); +$email=str_replace(" ","",$email); +$email_val=explode(",",$email); + $sth = $dbh->prepare("select iso,name from countries order by name"); $sth->execute(); while ($row=$sth->fetchrow_hash()) { $countries[]=$row; } $smarty->assign(array(countries=>$countries, - email_to=>$email_to, + email_val=>$email_val, )); include("common.inc"); -$main=$smarty->fetch("$main_file.tpl"); + +if (! isset($mailto)) { + $main=$smarty->fetch("$main_file.tpl"); +} else { + $main="Your comment is sent to $mailto. Thank you."; + include("quoted-printable.inc"); + iso_mail("$fullname ($country) <$email>",$mailto,$subject,$comment); +# $main.="
$mailto $fullname $email $country $subject $comment
"; +} $smarty->assign( array(MAIN=>$main, from=>$from, contact_section=>1,