--- contact.php 2001/03/05 15:22:27 1.6 +++ contact.php 2001/03/12 12:53:16 1.8 @@ -20,11 +20,18 @@ $from=str_replace(".php","",basename($HTTP_REFERER)); if (strstr($from,"?")) $from=substr($from,0,strpos($from,"?")); +$email="webmaster@pliva.hr"; // default + $sth = $dbh->prepare("select email from emails where referer='$from' limit 1"); $sth->execute(); -$email="webmaster@pliva.hr"; if ($row=$sth->fetchrow_hash()) { $email=$row[email]; +} else { + $sth = $dbh->prepare("select email from emails,menu where menu.section=referer and url='results.php?type=a'"); + $sth->execute(); + if ($row=$sth->fetchrow_hash()) { + $email=$row[email]; + } } $email=str_replace("\n","",$email); @@ -55,10 +62,5 @@ contact_section=>1, )); - -$smarty->assign("debug",$PHP_SELF." -- ".basename($PHP_SELF)." -- $section --". - $url[0] . "from: $from"); - - $smarty->display("index.tpl"); ?>