Variable in text box displays differently with print
Posted: Sun Nov 30, 2003 6:20 am
I'm trying to fill a text field with a value passed from a form on a previous page. The problem is the text passed ($Title) is all there but in the text box it only shows the first word. I found another way to display all the text but it will be tedious to code. Maybe someone can explain why the two processes work differently?
Code: Select all
<?php
$Title = "This is New Stuff";
print ("
<form action='NewBook.php' method='post' name='EditBook'>
<table width=80% cellspacing=5>
<tr>
<td></td>
<td><strong>Your Book Information</strong></td>
<td><strong>Matching Book Information</strong></td>
</tr>
<tr>
<td>Title</td>
<td><input name='Title' type='text' value=" . $Title . "></td>
<td></td>
</tr>
<tr>
<td>Title</td>
");
?>
<td><input name='Title' type='text' value=" <?php print $Title; ?> "></td>
<?php
print ("
<td></td>
</tr>
</table>
</form>
");
?>