Greetings,
I made a PHP script that runs next: index.php?page=SomePage.
Here is the code
[php]<?php
$page = $_GET['page'];
$form = $_GET['form'];
$action = $_GET['action'];
//------------------------------------------------------------
$library = $_GET[‘library’];
$content = $_GET[‘content’];
if (!$page)
$page = "Index";
if (!strpos($page, ".") && !strpos($page, "/")) {
if (!$library)
$library = "LCF/lib/";
if (!$content)
$path = "$library/page/".$page.".php";
else
$path = "$library/$content/".$page.".php";
}
if (isset($action))
$path = "$library/action/".$action.".php";
if (isset($form))
$path = "$library/form/".$form.".php";
include ($path);
?>
[/php]
So, I want to make it as php class, so I made something like this but it is not working…
[php]class DynamicLinkLibrary {
var $page;
var $content;
var $library;
var $path;
protected function __construct($page, $content, $library, $path) {
$this->page = $_GET['page'];
$this->content = $_GET['content'];
$this->library = $_GET['library'];
$this->path = $_GET['path'];
if(!$this->page)
$this->page = “Index”;
if(!strpos($this->page, ".") && !strpos($this->page, "/")) {
if(!$this->library)
$this->library = LCF_DIR.'lib/';
if(!$this->content)
$this->path = $this->library.'page/'.$this->page.'.php';
else
$this->path = $this->library.$this->content.'page/'.$this->page.'.php';
}
return self::$this->path;
}
}[/php]
What is the problem here?
All regards.