if(confirm('請先登錄MSN歐!')){document.location.href='http://event.zyxel.com.tw/everybodyloveme/"; echo "'}else{document.location.href='http://event.zyxel.com.tw/everybodyloveme/'};"; die(); } $link = mysql_connect($config['db_host'],$config['db_user'], $config['db_password']) or die("Could not connect : " . mysql_error()); mysql_select_db($config['db_name']) or die("Could not select database"); mysql_query("SET CHARACTER_SET_CLIENT = utf8, CHARACTER_SET_CONNECTION = utf8, CHARACTER_SET_DATABASE = utf8, CHARACTER_SET_RESULTS = utf8, CHARACTER_SET_SERVER = utf8, COLLATION_CONNECTION = utf8_general_ci, COLLATION_DATABASE = utf8_general_ci, COLLATION_SERVER = utf8_general_ci, AUTOCOMMIT=1"); if($vote_no!="" && $_SESSION["email"]!=""){ $query = "update everybodylove set vote=vote+1 where no='".$vote_no."'"; $result = mysql_query($query) or die("Query failed : " . mysql_error()); $query = "INSERT INTO everybodyvote(mail,vote,date) values('".$_SESSION["email"]."',1,'".date('Y-m-d H:i:s')."')"; $result = mysql_query($query) or die("Query failed : " . mysql_error()); } $query = "select mail from everybodyvote where mail='".$_SESSION["email"]."' and vote=1"; $result = mysql_query($query) or die("Query failed : " . mysql_error()); $RtnNum=mysql_num_rows($result); echo $RtnNum; if($RtnNum>=1){ mysql_free_result($result); //echo ""; $vote=1; } if($del!=""){ $query = "delete from everybodylove where no=$del"; $result = mysql_query($query) or die("Query failed : " . mysql_error()); echo ""; } mysql_query('SET NAMES utf8;'); if($print2=="yes"){ $query = "delete from everybodyvote"; $result = mysql_query($query) or die("Query failed : " . mysql_error()); $query = "update everybodylove set vote=0"; $result = mysql_query($query) or die("Query failed : " . mysql_error()); } $query = "select * from everybodylove where model='nsa' union select * from everybodylove where model='usg' order by vote desc"; $result = mysql_query($query) or die("Query failed : " . mysql_error()); $num_rows = mysql_num_rows($result); if($print=="yes"){ $query = "select * from everybodylove where 1 order by vote desc"; $result = mysql_query($query) or die("Query failed : " . mysql_error()); $num_rows = mysql_num_rows($result); } if($print1=="yes"){ $query = "select * from everybodyvote where 1"; $result = mysql_query($query) or die("Query failed : " . mysql_error()); $num_rows = mysql_num_rows($result); } if($print=="yes" || $print1=="yes"){ while($row = mysql_fetch_row($result)) { foreach($row as $value) { if ((!isset($value)) OR ($value == "")) { $value = "\t"; } else { $value = str_replace('"','"', $value); $value = '