Passing javascript variable to php file

You could use cookies – set in JS, and read from PHP.
Another way can be using an AJAX request to get the variable value.

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