Hello,
I'm working on incorporating PHP into a pretty basic HTML form somebody else made and have run into a problem getting special characters to appear. Mainly the problem is with apostrophe's and quotes.
In a nutshell the form is passing information via PHP to a MySQL database and then reloading that updated info. I first became aware of the issue when trying to submit a string of text with an apostrophe in it. This issue was resolved by using the addslashes() function. However, now when I retrieve a string that has an apostrophe in it, it in essence ends the value tag of the text field and doesn't display any of the string after the apostrophe.
Here is a shortened version of my code:
// variable from result of MySQL query
$hours1 = stripslashes($hours["hours1"]);
// html form code
<form enctype=multipart/form-data action='index2.php' method='post'>
<input type='text' name='hours1' value='$hours1'>
It seems that if the html sees an apostrophe in the string, it recogizes it as the end of the value assignment and thus closes the tag without displaying the rest of the text.
Anybody have a remedy for this problem? Any and all help would be appreciated.
Thanks in advance,
MTG