Instead of adding (/) into the database, you could use.
$currentPage = basename($_SERVER['PHP_SELF']);
Although before you insert it into the database, make sure you have escapted it.
Although its nice.
There is no need to use die here, you can change die() to $this->endpage();, if your using it in header.
For header useage use $this->endpage() or not header useage use $h->endpage();
Also i see you adding them, into the database as 1 row per page, you could change that and use pages for 1 row..
implode()/explode() or instead of using a database for this, use a text file, and serialize.