Disable stats / analytic javascript

My free web host adds javascript analytics to all PHP and HTML files. This is good, except that I use nuSoap to create a WSDL file for the web service I'm working on. My darn host adds this to my PHP WSDL file.

Some people suggested adding this to the .htaccess file:

AddType text/xml .php 

This is a dandy, but it also disables the PHP engine, and then there is no way to generate WSDL.

I searched everywhere, no luck. Webhost does not respond to emails or supports tickets.

Edit: The script my host is the histories. Published by Histats.com. In addition, this JavaScript block is outside the scope of the <html></html> tags and will not pass validation.

+4
source share
1 answer

According to the comment by @Gerben ...

Adding <!-- does not work. The host is already launching its additional commentary, and the --> that follows it is redefined.

Adding header('Content-Type: text/xml'); Does nothing, javascript still shows.

BUT! We found the answer ... put exit(); at the end of the PHP script will disable this feature!

As a note to Mr. @ Herben - Thank you, and I voted for one of your other answers, so you will get a loan for this ...

0
source

Source: https://habr.com/ru/post/1393565/


All Articles