Jump to content

Slashes, Help Needed

- - - - -

  • Please log in to reply
4 replies to this topic

#1
AtoZ

AtoZ

    Learning Programmer

  • Members
  • PipPipPip
  • 36 posts
I operate an online store, using custom software it all works great except when someone types a name such as George O'Neil, the responder doesn't execute or fails.

I've tried addSlashes and I've tried removing ' using a string replace.

Neither has worked, does anyone have any ideas?

#2
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
  • Location:Upstate, South Carolina
  • Programming Language:C, C++, PL/SQL, Delphi/Object Pascal, Pascal, Transact-SQL, Others
  • Learning:Java, C#, PHP, JavaScript, Lisp, Fortran, Haskell, Others
have you tried replacing ' with two of them?
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#3
AtoZ

AtoZ

    Learning Programmer

  • Members
  • PipPipPip
  • 36 posts
I've had a brain storm, I'm going to parse the strings with Javscript before the values are submitted.

#4
John

John

    Writes binary right handed and hex left handed

  • Moderators
  • 6,321 posts
  • Location:New York, NY
Use mysql_real_escape_string before inserting the data into the database.

#5
rhossis

rhossis

    Learning Programmer

  • Members
  • PipPipPip
  • 46 posts
Hi Atoz

Clientside validation is not enough. You need to sanitize all the user input on the server-side as well after form submission using php input validation methods an example of which has been given above PHP: SQL Injection - Manual. Remember, all user input is evil :bad:




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users