Jump to content

Recommended Posts

im trying to put the cssdiplay() values in the config .php but it doesnt write them

 

index.php

<?php

require("config.php");
require("main.class");

$cn = new build;

print $cn->display();


?>

 

 

 

config.php

<?php

$margin = "30px";
$back = "media/black.bmp";

?>

 

 

main.class

<?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();

?>

 

 

 

little help here?

 

Link to comment
https://forums.phpfreaks.com/topic/101712-using-configphp-with-a-class/
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.