--- contact.php 2001/02/19 16:22:20 1.1 +++ contact.php 2001/03/05 15:36:16 1.7 @@ -18,21 +18,42 @@ $smarty->assign( array ( lpic=>$lpic, lext=>$lext, mpic=>$mpic, Section_title=>$title ) ); $from=str_replace(".php","",basename($HTTP_REFERER)); +if (strstr($from,"?")) $from=substr($from,0,strpos($from,"?")); $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]; } -$main=$smarty->fetch("$main_file.tpl"); +$email=str_replace("\n","",$email); +$email=str_replace(" ","",$email); +$email_val=explode(",",$email); -$smarty->assign( array(MAIN=>$main, from=>$from, contact_section=>1, email_to=>$email_to )); - -$smarty->assign("debug",$PHP_SELF." -- ".basename($PHP_SELF)." -- $section --". - $url[0] . "from: $from"); +$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_val=>$email_val, + )); + +include("common.inc"); + +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) <$mailfrom>",$mailto,$subject,$comment); +# $main.="
$mailto $fullname $mailfrom $country $subject $comment
"; +} +$smarty->assign( array(MAIN=>$main, from=>$from, + contact_section=>1, + )); $smarty->display("index.tpl"); ?>