473,397 Members | 1,950 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

Remove all after certain character

229 100+
Hi, I wonder if anyone could help. I have been hacked and one field in my database has had html and links added after the original content.


http://www.website.com</title><style>.ajbv{position:absolute;clip:rect(481 px,auto,auto,446px);}</style><div class=ajbv><a href=http://ma

I need to remove everything after and including the title to leave only
http://www.website.com

Thanks for any help
Richard
Apr 27 '15 #1
2 1747
fran7
229 100+
hi, I solved it like this in the nd so thanks.

Expand|Select|Wrap|Line Numbers
  1. UPDATE tbl
  2. SET website= LEFT(website, CHARINDEX('<', website) - 1)
  3. WHERE CHARINDEX(';', website) > 0 
Thanks
Richard
Apr 27 '15 #2
Luuk
1,047 Expert 1GB
What?
You search for a ';', and replace anything before a '<'
That seems to be not the correct way!
(but might give correct results in this situation)

Secondly, restoring a backup might even be safer, after all someone changed thing in your system, and they might have change more than just this column.
Apr 27 '15 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: Steve | last post by:
string str ="\"C:\Program Files\Internet Explorer\iexplore.exe\" -nohome" How can I remove charcter to string str = ="C:\Program Files\Internet Explorer\iexplore.exe -nohome"
2
by: JIM.H. | last post by:
Hello, I have a string and I want to remove only certain string, if exits. Here is an example: “ABC,FCG,XXX,FFA”, I need to remove XXX and keep the rest in the string, how can I do that?...
6
by: Daniel Mark | last post by:
Hello all: I have the following snippet: In : fileName = 'Perfect Setup.txt\n' In : fileName = fileName # remove the '\n' character In : fileName Out: 'Perfect Setup.txt'
3
by: kababoom | last post by:
Hi i'm using Oracle 9i has any one encountered this strange problem whereby rtrim cannot trim certain character; for my case i notice it does not trim characters ending wif J or Q while the rest of...
3
by: rsennat | last post by:
hi, how do I remove the last character in a string only if its a "/". otherwise no need to remove the last character. im using std::string. tried with find_last_of( ). thanks rsennat
3
by: skris | last post by:
Hi All, I have some contents in a file named Msg.txt. I need to append the date right after the end of every line of that file. I tried out this code, but it did not work. >>> import datetime...
4
by: Unicon | last post by:
Hi Is there any code which can deactivate / corrupt (delete main table) whole database after certain period (like after 1 month / or 6 months). Please advise.
3
by: Aisya | last post by:
Hye, I need help to overcome the problem mention above. My application needs user to key in their details, but when it comes to name some names has an apostrophe, somehow it's okay to save the...
2
by: juhii3102 | last post by:
protected void btn_Edit_Click(object sender, EventArgs e) { Panel1.Visible = true; Button5.Visible = true; if (FileUpload1.HasFile) { //string...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.