Go Back   HostGator Peer Support Forums > HostGator Peer Support Forums > Web Hosting Services

Notices

Reply
 
Thread Tools
  #1  
Old 08-15-2010, 07:57 PM
pk698 pk698 is offline
Hatchling Croc
 
Join Date: Aug 2010
Posts: 5
Default mysql error when I enter the apostrophe in the text area

Hello.

my script gives a mysql error when I enter the apostrophe ' in a text area. does anyone know what could be causing it?

I did not write the script, but someone else did.

thanks.
Reply With Quote
  #2  
Old 08-15-2010, 08:08 PM
ceaser ceaser is offline
Junior Croc
 
Join Date: Jul 2008
Posts: 101
Default Re: mysql error when I enter the apostrophe in the text area

Whoever wrote the script didnt program the form content to be cleaned before being sent to the database. You have to escape the apostrophe and quotes with a \.

IE:
\' - html substitute = '
\" - html substitute = "
\n = newline
\t = tab
Reply With Quote
  #3  
Old 08-16-2010, 09:20 AM
Pazeh Pazeh is offline
King Croc
 
Join Date: Jan 2005
Posts: 1,327
Default Re: mysql error when I enter the apostrophe in the text area

Quote:
Originally Posted by pk698 View Post
Hello.

my script gives a mysql error when I enter the apostrophe ' in a text area. does anyone know what could be causing it?

I did not write the script, but someone else did.

thanks.
I say you are in a serious problem!! Your database is totally vulnerable to SQL injection attack, very very easily!! Especially if your visitors do have access to that text area & can enter some text.

Never ever pass any variable that a user enters to DB without first sterilizing it!

There are a dozen way to sterilize, clean a user input do google for "sql injection" and "sterilize sql" for more info.

But remember to do the fix asap!
Reply With Quote
  #4  
Old 08-16-2010, 10:16 PM
pk698 pk698 is offline
Hatchling Croc
 
Join Date: Aug 2010
Posts: 5
Default Re: mysql error when I enter the apostrophe in the text area

A friend wrote this for me, I don't know any coding. anyone willing to help me out?
Reply With Quote
  #5  
Old 08-17-2010, 08:56 AM
Pazeh Pazeh is offline
King Croc
 
Join Date: Jan 2005
Posts: 1,327
Default Re: mysql error when I enter the apostrophe in the text area

so the textarea is accessible by the visitors? if so, do PM me the url & I'll have a look
Reply With Quote
  #6  
Old 08-18-2010, 12:54 AM
pk698 pk698 is offline
Hatchling Croc
 
Join Date: Aug 2010
Posts: 5
Default Re: mysql error when I enter the apostrophe in the text area

I think I will just go ahead and get a programmer to recode it. Would be easier than trying to fix all the bugs.
Reply With Quote
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Editing text in images / editing text in flash mdawg Web Hosting Services 9 03-23-2009 11:51 AM
MySQL Error Kemistry Shared Hosting Support 3 06-12-2006 11:50 AM

All times are GMT -5. The time now is 05:45 PM.