$sub_num=30;
$page=$sub_num;
if(@$_GET[page]==""){
$num=$page;
}else{
$num=$_GET[page]*$sub_num;
}
# 讀取儲存檔案、計算檔案長度
$lines=file("studentsop/sub.dat");  
$count=count($lines);
for($a=($count-1);$a>=0;$a--){           
$line[]=$lines[$a];           
}
?> 
 
   
    |  學生相關 | 
 
  
    | 編 號 | 標 題 | 連 結 | 
 
# 用for迴圈來讀取公告筆數
for($i=0;$i<$count;$i++){
# 用if判斷句來擷取公告筆數的顯示範圍
if($i>=($num-$page)&&$i<$num){
# 先用list將sub.dat中的檔案分配好,在將檔案用explode()函數來分割
list($title,$updname,$hidden)=explode("∥",$line[$i]);
$id=$count-$i;
# 去除php中的斜線衝碼 
$title=stripslashes($title);
# 顯示列串
if($title): 
?> 
   
	| Warning:  Undefined variable $id in /home/unit/CWEL/cwel/public_html/department/studentsop_ch.php on line 94
 
 | Warning:  Undefined variable $title in /home/unit/CWEL/cwel/public_html/department/studentsop_ch.php on line 95
 
 |  | 
 
 
# 結束列串
endif;
}
}
?>