Solved

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

Posted on 2015-02-04
3
497 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
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…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

815 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now