[PHP]代碼
view source print?01
<?php
//----------------you should save this file as m.php----------------
02
session_start();
03
if
(
empty
(
$page
)) {
$page
=1;}
04
if
(isset(
$_GET
[
'page'
])==TRUE) {
$page
=
$_GET
[
'page'
]; }
05
?>
06
<html>
07
<head>
08
<meta http-equiv=
"Content-Type"
content=
"text/html; charset=UTF-8"
/>
09
<title>www.qqview.com-Read Result</title>
10
<style type=
"text/css"
>
11
<!--
12
.STYLE1 {font-size: 12px}
13
.STYLE2 {font-size: 18px}
14
-->
15
</style>
16
</head>
17
<body>
18
<table width=
"100%"
bgcolor=
"#CCCCCC"
>
19
<tr>
20
<td >
21
<?php
22
if
(
$page
){
23
$counter
=
file_get_contents
(
"example.txt"
);
//-------read the file into a string.-------
24
$length
=
strlen
(
$counter
);
25
$page_count
=
ceil
(
$length
/5000);
26
27
function
msubstr(
$str
,
$start
,
$len
){
28
$strlength
=
$start
+
$len
;
29
$tmpstr
=
""
;
30
for
(
$i
=0;
$i
<
$strlength
;
$i
++) {
31
if
(ord(
substr
(
$str
,
$i
,1))==0x0a) {
32
$tmpstr
.=
'<br />'
;
33
&nbs