473,386 Members | 1,736 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,386 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 1746
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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,...

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.