I have a script that writes (fwrite) a simple html page. In the script I have an input box:
<input name="rest_name" type="text" size="20" maxlength="100" value='<?php echo "$rest_name_old"; ?>' onfocus="clearDefault(this)"/>
the default value is pulled from a database
Users can type text into the box and hit submit, the content is then fwritten to anhtml page:
$rest_name = stripslashes($rest_name);
$stringData = "<h1>$rest_name</h1>\n";
fwrite($fh, $stringData);
p.s. I have tried it without the stripslashes and it's still broke
In my database and in the html page everything is fine. But when they go to edit the page later the default value of the text box is only echoed until the first apostrophe.
Example:
user enter mike's place in the text box and hits submit
the database is updated correctly and the html page echos "mike's place" as it should
later the user needs to change the data so they bring up the editing script
the text box default value should be "mike's place" but it only shows "mike"