PHP beginner |
|
Ik zit nu even helemaal muurvast. De error en de code staan hieronder.
Fatal error: Cannot access empty property in /mnt/web2/30/37/52095937/htdocs/snacks4u/includes/pages/home.php on line 16
Fatal error: Cannot access empty property in /mnt/web2/30/37/52095937/htdocs/snacks4u/includes/pages/home.php on line 16
deel classe:
private $pageSysConn = "";
public $page = "";
public function __construct($mysql_host, $mysql_user, $mysql_pass, $mysql_database) {
$this -> pageSysConn = mysql_connect($mysql_host, $mysql_user, $mysql_pass);
mysql_select_db($mysql_database, $this -> pageSysConn);
}
private $pageSysConn = ""; public $page = ""; public function __construct($mysql_host, $mysql_user, $mysql_pass, $mysql_database) { $this -> pageSysConn = mysql_connect($mysql_host, $mysql_user, $mysql_pass); }
pagina:
$ps = new pageSys($mysql['host'], $mysql['username'], $mysql['password'], $mysql['database']);
$ps -> $page = 'home'; // dit is lijn 16
$pageName = $ps -> _getPageName();
$pageHead = "<h2>" . $ps -> _getPageHead() . "</h2>";
$pageContent = "<p>" . $ps -> _getPageContent() . "</p>";
$ps = new pageSys($mysql['host'], $mysql['username'], $mysql['password'], $mysql['database']); $ps -> $page = 'home'; // dit is lijn 16 $pageName = $ps -> _getPageName(); $pageHead = "<h2>" . $ps -> _getPageHead() . "</h2>"; $pageContent = "<p>" . $ps -> _getPageContent() . "</p>";
Nu is mijn vraag, waarom werkt dit niet?!?
|