Solved

MySQL - need to remove all occurrence of Adblock code from my html.

Posted on 2015-02-04
3
500 Views
Last Modified: 2015-02-04
Hi,
one of my customers has been using  Adblock Plus while editing pages in html editor which has resulted in an abp attribute bring added to every element.

<h1 abp="861">Text </h1>
<p abp="877" colspan="2">&nbsp;</p>
<p abp="873">&nbsp;</p>

Open in new window


Is there an easy way to search and remove all abp="some number" code using MySQL or PHP?

Thanks
0
Comment
Question by:sabecs
  • 2
3 Comments
 
LVL 34

Accepted Solution

by:
Dan Craciun earned 500 total points
ID: 40588079
Read each page from your database into a variable, delete those codes and then update the db with the content of the variable.

This will delete all occurrences of ' abp="123"' from a string:
$content = preg_replace("/ abp=\"\d+\"/", "", $content);

HTH,
Dan
0
 

Author Closing Comment

by:sabecs
ID: 40590399
Thanks Dan, that is perfect...
0
 
LVL 34

Expert Comment

by:Dan Craciun
ID: 40590401
You're welcome.
Glad I could help!
0

Featured Post

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question