Question

I am having trouble with getting PHP to read the whole string.

I currently have...

<input type="text" name="example" value="My name's Simon" />

I have added addslashes($_POST['example'])

However when I echo to check the output it only reads "My name\" and then will not read any more. Can anyone help with this?

I am using it to update a row in MySQL and obviously if the input is not matching, it is not updating the table. How can I get it to read the whole string after the backslash?

(The code currently works fine and updates the table correctly when there is no single quotes/apostrophe).

Any help would be much appreciated.

Thank you.

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top