-

 -

  •     - - . : Internet Explorer 6, Fire Fox 1.5, Opera 9.5, Safari 3.1.1 JavaScript.

 -

   Net-man

 - e-mail

 

 -

 LiveInternet.ru:
: 20.04.2010
: 814
: 5985
: 11575

:


PHP:

, 22 2011 . 19:29 +

, . , . "data", . , main.html, about.html, works.html contacts.html. ( "data") index.php, .

    <?PHP
     
    // php: -
    //
     
    //
    

$max = 0;
    
//
    $page = main;
     
    
// *.txt "data"
    foreach (glob("data/*.html") as $filename) $max++;
     
// $max
    // ,
    // ...
    // $_GET['page']
    if (isset($_GET['page']) and trim($_GET['page']) != "") {
      // $page
      $page = trim($_GET['page']);
      }
     
    // $page
    $file = "data/".$page.".html";

// , , ?
    if (file_exists($file)) {
      // ,
      $title = " ".$page.".html";
      $content = file_get_contents($file);
      }
    else {
      // ,
      $title = " ".$page.".html ";
      $content = "<h3>".$title."</h3>";
      }

?>
    <html>
    <head>
    <title><?PHP echo $title; ?></title>
    </head>
    <body>
    <a href="?page=main">main</a><br>
    <a href="?page=about">about</a><br>
    <a href="?page=works">works</a><br>
    <a href="?page=contacts">contacts</a>
    ?></h1>
    <?PHP echo $content; ?>
    </body>
    </html>

header.php footer.php. header.php - "" . . , , , .. footer.php. . , . , "data". , , , , . index.php : require_once("header.php"); require_once("footer.php"); .

PHP
:  

1

_   , 23 2011 . 21:02 ()
)
   
: [1] []
 

:
: 

: ( )

:

  URL