Hi,
Code below generates this error Warning: Missing argument 1, 2, 3for MyWebpage::pageElements(): Class_for_HTML.class on line 18 )
but i cannot solve the problem.
Thanks
<?php
class MyWebpage {
var $header = "<html>\n<head>\n";
var $title;
var $keywords;
var $content;
var $footer = "</body></html>";
function generatePage() {
echo $this->header;
$this->pageElements();
echo "<meta name=\"keywords\" content=\"". $this->keywords. "\">\n";
echo "<title>". $this->title. "</title>\n";
echo "<body>\n". $this->content ."\n";
echo $this->footer;
}
function pageElements($pageTitle, $pageKeywords, $pageContent) {
$this->title = $pageTitle;
$this->keywords = $pageKeywords;
$this->content = $pageContent;
}
}
?>
<?php
require_once("class_for_HTML.class");
$createSample = new MyWebpage();
$pageTitle = "Test page";
$pageKeywords = "php, class, object";
$pageContent = "<h1>This page has been generated by a class</h1>\n";
$createSample->pageElements($pageTitle, $pageKeywords, $pageContent);
$createSample->generatePage();
?>