I am having a problem with a form.
I am getting a set of text variables. I am using these variables as the "Value" for text types in an HTML form.
The variables are complete when I echo them, but when I use them as the value in the form, they truncate at the first space.
Here are the results of the echo:
[INDENT]ISBN: 1893115518
Title: Beginning PHP 5 and MySQL: From Novice to Professional
Title Long:
Author: W. J. Gilmore[/INDENT]
Here is the code that generates the above:
$Title = trim(str_replace(',','',$parsedXML[Title]));
$TitleLong = trim(str_replace(',','',$parsedXML[TitleLong]));
$Author = trim(str_replace(',','',$parsedXML[AuthorsText]));
echo ("<br>");
echo ("ISBN: ");
echo $ISBN;
echo ("<br>");
echo ("<br>");
echo ("Title: ");
echo $Title;
echo ("<br>");
echo ("<br>");
echo ("Title Long: ");
echo $TitleLong;
echo ("<br>");
echo ("<br>");
echo ("Author: ");
echo $Author;
echo ("<br>");
Here is the Form code (the previous code is in the Include file):
<?PHP
$ISBN=trim($_POST['ISBN']);
include_once 'somefile.php';
echo "<form action='somefileother.php' method='post'>";
echo "<table border='0'>";
echo "<tr><td>ISBN</td><td><input type=text name='ISBN' value=$ISBN></td></tr>";
echo "<tr><td>Title</td><td><input type=text name='Title' value=$Title></td></tr>";
echo "<tr><td>Long Title</td><td><input type=text name='TitleLong' value=$TitleLong></td></tr>";
echo "<tr><td>Author</td><td><input type=text name='Author' value=$Author></td></tr>";
echo "<tr><td>Notes</td><td><input type=text name='additionalinfo'></td></tr>";
echo "</table>";
echo "<input type=submit>";
echo "</form>";
?>
The form values are:
[INDENT]1893115518
Beginning
W.
[/INDENT]
I would appreciate any help. I have tried htmlspecialchars() and it didn't do any good.
Thanks.