Output Sanitation

Your code is working correctly. If you look at the source code of the page, you will see:

<script>alert('Test')</script>

When the above text gets processed for display by your browser, it then becomes

<script>alert('Test')</script>

which is what you want to be displayed.

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