domain' and id = '$mbox_user->userid' and email = '$addr_email'", $mysql["conn"]); if(mysql_num_rows($result)) { echo(" "); } else { mysql_query("insert into $mysql[tadd] (mbox_host, id, email, usernm, title, company, work, home, fax, mobile, msn, icq, street, zip, country, birthday, website, note, favorite) values ('$mbox_user->domain', '$mbox_user->userid', '$addr_email', '$addr_usernm', '$addr_title', '$addr_company', '$addr_work', '$addr_home', '$addr_fax', '$addr_mobile', '$addr_msn', '$addr_icq', '$addr_street', '$addr_zip', 'KR', '$addr_birth', '$addr_website', '$addr_note', '$addr_favorite')", $mysql["conn"]); header("Location: mailaddr.html"); } break; case "update": if($addr_zip1 != "" && $addr_zip2 != "") $addr_zip = $addr_zip1."-".$addr_zip2; else $addr_zip = ""; if($addr_birth1 != "" && $addr_birth2 != "" && $addr_birth3 != "") $addr_birth = $addr_birth1."-".$addr_birth2."-".$addr_birth3; else $addr_birth = ""; if($addr_website != "" && !eregi("^http", $addr_website)) $addr_website = "http://".$addr_website; if($addr_favority != "Y") $addr_favority = "N"; if($addr_email == $addr_hidval) { mysql_query("update $mysql[tadd] set email = '$addr_email', usernm = '$addr_usernm', title = '$addr_title', company = '$addr_company', work = '$addr_work', home = '$addr_home', fax = '$addr_fax', mobile = '$addr_mobile', msn = '$addr_msn', icq = '$addr_icq', street = '$addr_street', zip = '$addr_zip', birthday = '$addr_birth', website = '$addr_website', note = '$addr_note', favorite = '$addr_favorite' where mbox_host = '$mbox_user->domain' and id = '$mbox_user->userid' and email = '$addr_hidval'", $mysql["conn"]); header("Location: mailaddr.html"); } else { $result = mysql_query("select * from $mysql[tadd] where mbox_host = '$mbox_user->domain' and id = '$mbox_user->userid' and email = '$addr_email'", $mysql["conn"]); if(mysql_num_rows($result)) { echo(" "); } else { mysql_query("update $mysql[tadd] set email = '$addr_email', usernm = '$addr_usernm', title = '$addr_title', company = '$addr_company', work = '$addr_work', home = '$addr_home', fax = '$addr_fax', mobile = '$addr_mobile', msn = '$addr_msn', icq = '$addr_icq', street = '$addr_street', zip = '$addr_zip', birthday = '$addr_birth', website = '$addr_website', note = '$addr_note', favorite = '$addr_favorite' where mbox_host = '$mbox_user->domain' and id = '$mbox_user->userid' and email = '$addr_hidval'", $mysql["conn"]); header("Location: mailaddr.html"); } } break; case "quick": if($addr_favority != "Y") $addr_favority = "N"; $result = mysql_query("select * from $mysql[tadd] where mbox_host = '$mbox_user->domain' and id = '$mbox_user->userid' and email = '$addr_email'", $mysql["conn"]); if(mysql_num_rows($result)) { echo(" "); } else { mysql_query("insert into $mysql[tadd] (mbox_host, id, email, usernm, country, favorite) values ('$mbox_user->domain', '$mbox_user->userid', '$addr_email', '$addr_usernm', 'KR', '$addr_favorite')", $mysql["conn"]); header("Location: mailaddr.html"); } break; } } if($mode == "modify") { $result = mysql_query("select * from $mysql[tadd] where mbox_host = '$mbox_user->domain' and id = '$mbox_user->userid' and email = '$mmel'", $mysql["conn"]); $row = mysql_fetch_array($result); } include("include/mbox_head.html"); ?>