Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <link rel="shortcut icon" href="/images/favicon.ico" type="image/x-icon">
- <meta http-equiv="Content-Type" content="text/html; charset=windows-1251">
- <title>Интерактивные книги</title>
- <style>
- a:link { color:black; font-weight:bold; text-decoration:none }
- a:visited { color:black; font-weight:bold; text-decoration:none }
- a:hover { color:crimson; font-weight:bold; text-decoration:none }
- a:active { color:green; font-weight:bold; text-decoration:none }
- p:first-letter { color:crimson; font-weight:bolder;
- padding:0px 0px 0px 15px; }
- </style>
- </head>
- <body>
- <br>
- <div style="position: relative; left:25px; right:25px;
- width:600px; text-align:justify">
- <?php
- if (!isset($_GET["book"]) or $_GET["book"]=="" or $_GET["page"]=="0000") {
- echo "Список книг:<br>";
- $dir=opendir("books");
- while ($file=readdir($dir)) {
- if ($file!=".." and $file!=".") {
- echo '<a href="http://timkruz.tk/read?book='.$file.'">'.$file."</a><br>";
- }
- }
- } else {
- $book=$_GET["book"];
- if (!isset($_GET["page"])) $page="$0001";
- else {
- switch(strlen($_GET["page"])) {
- case 1: $page="$000".$_GET["page"]; break;
- case 2: $page="$00".$_GET["page"]; break;
- case 3: $page="$0".$_GET["page"]; break;
- case 4: $page="$".$_GET["page"]; break;
- }
- }
- $file=fopen("books/".$book,"r");
- if ($file) {
- $pagen="$0001";
- while (!feof($file)) {
- $text=chop(fgets($file));
- if ($text[0]=="$") $pagen=$text;
- if ($text[0]=="%" and $pagen==$page) {
- echo '<a href="?book='.$_GET["book"].'&page='.$text[1].$text[2].$text[3].$text[4].'">';
- $openA=true;
- }
- if (!($text[0]=="$" or $text[0]=="%")) {
- if ($pagen==$page) {
- echo "<p>".$text."</p>";
- if ($openA) {
- echo "</a>";
- $openA=false;
- }
- }
- }
- }
- fclose($file);
- } else {
- echo 'Книги "'.$_GET["book"].'" у нас нет.<br><a href=".">Назад</a>';
- }
- }
- ?>
- </div>
- </body>
- </html>
Add Comment
Please, Sign In to add comment