How to get the real address from a url (permalink)

have you looked at $_SERVER

 $real_address = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
 echo $real_address;

This code grabs your url with it’s parameters and saves it to the $real_address variable

Also have a look at this link here

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