Jump to content


Photo

php class error


  • Please log in to reply
1 reply to this topic

#1 ap_

ap_

    Young Padawan

  • Members
  • Pip
  • 31 posts

Posted 18 April 2008 - 06:14 AM

little help
i have a config.php with the cssdisplay() variable values but it doesnt write them any ideas.

<?php

ob_start();

class build{

var $title;
var $keywords;
var $margin;
var $backg;
var $font;
var $linkcolor;
var $none;


public function display(){
	print("<html>\n");
	print("<head>\n");
	print("<title>$this->title \n");
	print(" $this->keywords</title>\n");
	print $this->cssdisplay();
	print("<head>\n");
	print("<body>\n");
	//print $this->maincontent();
	print("</body>\n");
	print("</html>");

}


public function cssdisplay(){

	print("<style type=text/css>\n");
	print("	body{\n");
	print("	margin-top: $this->margin;\n");
	print("	background: url('$this->backg');\n");
	print("	font: $this->font;\n");
	print("}\n");
	print("a:link{color: $this->linkcolor;}\n");
	print("a:active{color: $this->linkcolor;}\n");
	print("a:visited{color: $this->linkcolor;}\n");
	print("a:hover{color: $this->linkcolor; text-decoration: $this->none;}\n");
	print("</style>");


}


}
ob_end_flush();

?>


config.php
$margin = "30px";
$back = "media/black.gif";

Edited by ap_, 18 April 2008 - 08:48 AM.


#2 rc69

rc69

    PHP Master PD

  • P2L Staff
  • PipPipPipPip
  • 3,827 posts
  • Gender:Male
  • Location:Here
  • Interests:Web Development

Posted 18 April 2008 - 08:10 PM

ref: http://php.net/manua...ables.scope.php




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users