include("configes.php");
session_start();
//刪除留言
if($_GET['job'] == 'del' && $_SESSION['user'] == 'super' && $_GET['id'] !=''){
@$link = mysql_connect("localhost",$acc_id,$acc_pw);
@mysql_select_db($acc_name);
$str = "delete from $acc_all where serica='".$_GET['id']."'";
@$list = mysql_query($str,$link) or die(mysql_err());
@mysql_close($link);
error('留言刪除完成');
exit;
}
if($_GET['job'] =='out'){
session_destroy();
error('感謝使用!');
exit;
}
//讀取留言筆數計算
if(word($_GET['p']=='')){ $_GET['p']='1';}
if(word($_GET['p']) !=''){ //開資料庫
@$link = mysql_connect("localhost",$acc_id,$acc_pw);
@mysql_select_db($acc_name);
$str = "select count(*) from $acc_all";
@$list = mysql_query($str,$link) or die(mysql_err());
list($count) = mysql_fetch_row($list);
$all_gamer = $count; //全部留言筆數
$all_page = ceil($count/$max_page); //全部頁數
//讀取目前頁面內容
$p = $_GET['p'];
if($p <= 1 || $p > $all_page){$p = 1;}
$s_page = ($p-1)*$max_page; //開始筆數
//開始讀取每筆資料後,將資料放入
$str ="select serica,name,tel,addr,mail,msg,rp_msg,hide,mtime,rtime from $acc_all order by serica desc limit $s_page,$max_page";
@$list=mysql_query($str,$link) or die(mysql_err());
$i=1;
while(list($xa,$xb,$xc,$xd,$xe,$xf,$xg,$xh,$xi,$xj)=mysql_fetch_row($list)){
$wa[$i]=$xa;
$wb[$i]=$xb;
$wc[$i]=$xc;
$wd[$i]=$xd;
$we[$i]=$xe;
$wf[$i]=$xf;
$wg[$i]=$xg;
$wh[$i]=$xh;
$wi[$i]=$xi;
$wj[$i]=$xj;
$i++;
}
@mysql_close($link);
}
?>
學習電子報 勵志感人故事好文章欣賞