Page 1 of 1

Filling form from database

Posted: Sun Feb 15, 2004 9:51 pm
by sinewave
I am trying to fill a form from a database search.

Whenever a record has spaces if i try to fill the input form by doing:

Code: Select all

<?php
<input name='example' type='text' size='65' value=".$row["example"].">
?>
It will display the first word and then nothing else. I'm assuming it is because of the spaces. What can i do?

Posted: Sun Feb 15, 2004 11:02 pm
by Illusionist
this is wrong:

Code: Select all

value=".$row&#1111;"example"]."
try this instead:

Code: Select all

value=<?=$row&#1111;'example']?>

Posted: Sun Feb 15, 2004 11:08 pm
by sinewave
actually it isnt wrong. The whole thing is in an echo();
I should have put that.


The code works, it just doesnt work after the first space and i realized why.

I dont have quotes around it. Thanks for your help though.

Posted: Sun Feb 15, 2004 11:10 pm
by Illusionist
ok, yes you should have included that bit of code... try looking at urlencode() and urldecode()