I'm having problems submitted data from a text area into a database when it includes " after passing it through a link.
Theres three pages, one.php, two.php, and three.php
one.php contains a form:
print '<form method=POST action="two.php">
<textarea rows="5" name="addy" cols="20"></textarea>';
two.php contains the results and a link to submit the data into a database, kind of a preview of what its about to send:
echo $addy;
print '<a href="three.php?addy='.$addy.'">';
three.php contains the command to upload:
$result = mysql_query("INSERT INTO table VALUES('$addy')");
The problem is, if they put anything with a " in the text box, the script won't insert anything after the " into the database.
So if I put:
1 "2" 3 4 5
It would insert:
1 \
I've tried stripslashes()
The only way to fix it is if I remove the " using ereg_replace() and it worked, so it must be the "
Any help would be appreciated