Page 1 of 1

print only to space

Posted: Tue Jul 12, 2005 10:06 am
by jfigueiredo
Hi ,

Need some help

I get data from postgre, but when i passed to text it cuts to space the code is:
echo "<tr><td><font szie=2>First name:</td><td><input type=text name=Fname value=" . $row['Fname'] . "></td></tr>";

tre result if Fname ='Peter David' is 'Peter', dont show anything after the space

Thanks in advance

Posted: Tue Jul 12, 2005 12:31 pm
by anjanesh
Change your echo to

Code: Select all

echo '<tr><td><font szie=2>First name:</td><td><input type=text name=Fname value="'.$row['Fname'].'"></td></tr>';
Your echo is outputing to the browser as HTML like this

Code: Select all

&lt;input type=text name=Fname value=Peter David&gt;
when it should be :

Code: Select all

&lt;input type=text name=Fname value=&quote;Peter David&quote;&gt;
The value has to come within quotes ("") to accept blanks.

Posted: Wed Jul 13, 2005 4:27 am
by jfigueiredo
That's rigth, works fine

Thanks