I have resolved a couple issues on my site thanks to you all, and hoping that you can come to my rescue one last time, because I am at wit's end trying to figure this one out.
I have a shopping list on each page. Normal grocery store items; users select products and add it to their shopping list.
My problem is that beside each item is a checkbox..and at the bottom of the form is the submit button. If a user wants to delete an item from their shopping list, they just check the checkbox and hit 'Delete from cart' button. This works fine....if the item they are deleting is one word with no special characters. For example, if I want to delete milk or eggs, no problem, it gets deleted.
But if the item contains more than one word, or special characters, like a single quote, the delete does not work. For example, white bread or Jack's will not get deleted.
Now I have tried to troubleshoot as far as I can, and here's what I've found to be the problem -- when I echo the $variable that contains the item to be deleted, it only echos the FIRST word of a multiword item. To clarify, if I am trying to delete white bread, for some reason, it is only trying to delete an item named WHITE from the database, not WHITE BREAD.
Hopefully, my explanation wasn't confusing and if more info is needed let me know..I'm just not sure how to fix this. I've tried appending addslashes(), stripslashes(), trim() to the variable, but no success.