Unable to enter a Google ad into a story

0

Good morning everyone,

I would like to introduce a Google ad in the middle of a story, but the code is not correct. I do not know if I can put the code directly so I'm not going to put the script, it has the typical structure of Google ads.

I edit to add the code:

<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- anuncios -->
<ins class="adsbygoogle"
     style="display:block"
     data-ad-client="ca-pub-97601142716609XX"
     data-ad-slot="62861274XX"
     data-ad-format="auto"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>

The fact is that for whatever reason the code in the text is shown like this:

For the creator of new articles, which is a tool that I have created myself, I do not go through any filter of strip_tags() or htmlspecialchars() , since I am the only one that publishes articles. Therefore, I do not understand why he is doing that to me.

The information of the text I collect it in the following way:

$articulo = $_POST['articulo'];
$articulo = a_html($articulo);
$articulo = para_vista_previa($articulo);

Where the two functions is just to translate some tags that I have added to the text editor and translate it to html code.

What can it be due to?

    
asked by JetLagFox 20.07.2017 в 17:18
source

1 answer

0

Finally I have solved it by removing all the spaces, if I left any one I included a <br> and the code did not work.

    
answered by 21.07.2017 в 01:14