diff --git a/contact.php b/contact.php
index e7732e2..68663fb 100644
--- a/contact.php
+++ b/contact.php
@@ -34,7 +34,7 @@
if($_POST['to'] && $_POST['subject'] && $_POST['message'] && $_POST['from'] && $_POST['fromemail']) {
if(isEmailAddress($_POST['fromemail'])) {
list($id,$md5email)=split(":",$_POST['to']);
- $q=mysql_query("SELECT * FROM users WHERE id='$id'");
+ $q=mysql_query("SELECT * FROM users WHERE uid='$id' ORDER BY year DESC LIMIT 1");
$r=mysql_fetch_object($q);
//if a valid selection is made from the list, then this will always match.
if($md5email == md5($r->email)) {
@@ -104,7 +104,7 @@ function tochange() {
if($r2->email) {
$name=$r2->firstname.' '.$r2->lastname;
if($r2->title) $titlestr=" ($r2->title)"; else $titlestr="";
- echo "\n";
+ echo "\n";
}
}
}