need help about <input value>

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
rexicon
Forum Newbie
Posts: 4
Joined: Mon Aug 03, 2009 3:21 am

need help about <input value>

Post by rexicon »

i store the value of my select statement result to an array and stored it to a variable named $fname the i used it as the value of:

<input type='text' name='fname' value=<?php echo $fname ?> />

but when $fname's value is more than 1 word it only displays the first word, but when i:

echo $fname;

i get the right result. What is the problem with this?

Need help. ASAP.

Thanks,

Rexicon
guosheng1987
Forum Newbie
Posts: 24
Joined: Thu Oct 15, 2009 3:03 am

Re: need help about <input value>

Post by guosheng1987 »

use funtion "print_r" to output array
rexicon
Forum Newbie
Posts: 4
Joined: Mon Aug 03, 2009 3:21 am

Re: need help about <input value>

Post by rexicon »

how do i use it? can u give a sample code for that, im new in php.

thanks,

rexicon
guosheng1987
Forum Newbie
Posts: 24
Joined: Thu Oct 15, 2009 3:03 am

Re: need help about <input value>

Post by guosheng1987 »

print_r($fname);
rexicon
Forum Newbie
Posts: 4
Joined: Mon Aug 03, 2009 3:21 am

Re: need help about <input value>

Post by rexicon »

it's still the same output, only the first word appears the second word does not appear.

here's a sample code:
<?php
.
.

while ($row = oci_fetch_array($result))
{
$fname = $row['FIRST_NAME'];
}
?>

<html>
.
.
.
<input type='text' name='fname' value=<?php echo $fname ?> />
.
.
</html>
Post Reply