Advertisement
Guest User

Untitled

a guest
Jul 21st, 2017
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.62 KB | None | 0 0
  1. <?php
  2. class Page {
  3. var $content;
  4. var $footer;
  5. var $title;
  6.    function Display( ) {
  7.      $this->displayheader();
  8.      $this->displaycontent();
  9.      $this->displayfooter();
  10.        }
  11.  
  12.    function displayheader( ) {
  13.    echo "<html><head>";
  14.      echo "<TITLE>" . $this->title . "</TITLE>\n</head>";
  15.    }
  16.  
  17.    function displaycontent(){
  18.    echo "<body>".$this->content;
  19.    }
  20.    function displayfooter(){
  21.    echo "<div>".$this->footer."</div></body></html>";
  22.    }
  23.  }
  24. ?>
  25.  
  26. <?php
  27.  
  28. $page = new Page;
  29.  
  30. $page->title = "PHP klase";
  31. $page->content = "Test";
  32. $page->copyright = "D4T4X copyright";
  33. $page->Display();
  34.  
  35. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement