Syntax Errors With Apostrophe's

5 replies
I have successfully installed a JV giveaway script. However, I noticed that on certain pages as admin AND as a participant, it creates sql syntax errors regarding apostrophes. I can manually go in and resolve the problem by eliminating the apostrophes so I assume this is a quick fix somewhere but I am not "techy" enough to resolve. Any help about where to go, what to do, etc. would be greatly appreciated

Sincerely,

Craig
#apostrophe #errors #syntax
  • Profile picture of the author Brandon Tanner
    Basically what that means is whoever coded the script was being lazy and did not properly sanitize the text inputs. In PHP, the value of a variable is put inside quotes (apostrophes), so whenever the script runs into a quote inside a variable, it thinks that the variable has ended... which will lead to all kinds of syntax errors.

    The fix is to sanitize the quotes in all variables before they are sent to the SQL database...

    PHP: htmlspecialchars - Manual

    Alternately, you could do this...

    http://php.net/manual/en/function.my...ape-string.php
    Signature

    {{ DiscussionBoard.errors[7545537].message }}
  • Profile picture of the author SteveJohnson
    Your best bet would be to contact the script author.

    Brandon explained why your issue is occurring, but if you're not experienced enough to be able to even download, edit, and upload a file with FTP this is going to be an exercise in frustration for you. It's kind of like trying to fix a TV without knowing what a multimeter is or how to use it.

    There's no way that any of us could tell you exactly where to look or what to change without being able to see the code - even then it would take a while to trace exactly where the error is being introduced.
    Signature

    The 2nd Amendment, 1789 - The Original Homeland Security.

    Gun control means never having to say, "I missed you."

    {{ DiscussionBoard.errors[7548550].message }}
    • Profile picture of the author Brandon Tanner
      Originally Posted by SteveJohnson View Post

      Your best bet would be to contact the script author.

      Brandon explained why your issue is occurring, but if you're not experienced enough to be able to even download, edit, and upload a file with FTP this is going to be an exercise in frustration for you. It's kind of like trying to fix a TV without knowing what a multimeter is or how to use it.

      There's no way that any of us could tell you exactly where to look or what to change without being able to see the code - even then it would take a while to trace exactly where the error is being introduced.
      ^^ What Steve said. If you're not comfortable editing PHP / MySQL, then save your sanity and contact the script developer about this (or outsource the work to someone else who knows what they're doing).
      Signature

      {{ DiscussionBoard.errors[7549088].message }}

Trending Topics