--- contact.php 2001/03/12 12:53:16 1.8 +++ contact.php 2001/03/12 20:05:04 1.9 @@ -17,8 +17,10 @@ $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,"?")); +if (! isset($from) || $from == "") { + $from=str_replace(".php","",basename($HTTP_REFERER)); + if (strstr($from,"?")) $from=substr($from,0,strpos($from,"?")); +} $email="webmaster@pliva.hr"; // default @@ -27,7 +29,7 @@ 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 = $dbh->prepare("select email from emails,menu where menu.section=referer and url like '$from%'"); $sth->execute(); if ($row=$sth->fetchrow_hash()) { $email=$row[email];