Filling form from database

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
sinewave
Forum Commoner
Posts: 41
Joined: Tue Sep 10, 2002 4:35 pm
Location: Canada

Filling form from database

Post 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?
Illusionist
Forum Regular
Posts: 903
Joined: Mon Jan 12, 2004 9:32 pm

Post by Illusionist »

this is wrong:

Code: Select all

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

Code: Select all

value=<?=$row&#1111;'example']?>
sinewave
Forum Commoner
Posts: 41
Joined: Tue Sep 10, 2002 4:35 pm
Location: Canada

Post 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.
Illusionist
Forum Regular
Posts: 903
Joined: Mon Jan 12, 2004 9:32 pm

Post by Illusionist »

ok, yes you should have included that bit of code... try looking at urlencode() and urldecode()
Post Reply