This sounds like a common problem caused by poorly constructed html and an unquoted string. You should look at the source code of your html pages carefully for clues about what is going wrong.
Code:
// what you probably have
<input type=hidden value=Several great book titles />
// what you should have
<input type=hidden value="Several great book titles" />
Briefly, these are acceptable to most browsers:
Code:
// a string without a space
<input type=hidden value=Several />
// a number
<input type=hidden value=23 />
Which might explain why sometimes it seems to just work, and other times it does not.
PHP Code:
// you can quote with single quotes if you want to:
echo "<input type=hidden value='Several great book' titles />". PHP_EOL ;
// OR **
echo '<input type=hidden value="Several great book" titles />'. PHP_EOL ;
// OR
echo '<input type=hidden value=\'Several great book\' titles />'. PHP_EOL ;
// OR **
echo "<input type=hidden value=\"Several great book\" titles />". PHP_EOL ;
This gets especially messy when you start outputting JS and its own quoting needs, then look at using heredoc
** these might be the only ones to pass very strict x/html validation.
Bookmarks