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.


class MyWebpage {
	var $header = "<html>\n<head>\n";
	var $title;
	var $keywords;
	var $content;
	var $footer = "</body></html>";

	function generatePage() {
		echo $this->header;
		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;

$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);

In the bottom example:

$createSample->pageElements($pageTitle, $pageKeywords, $pageContent);

In the upper example:


Here, the 3 parameters are missing. But I think you can remove the line.

This question has already been answered. Start a new discussion instead.