Get the current page in a call back function

You need the protocol, the host name and the (root relative) request URL. Then stick them together:

$scheme="http" . ( is_ssl() ? '' : 's' ) . '://';
$url    = $scheme . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)