Forum Moderators: coopster

Message Too Old, No Replies

Need php genius

echo $variable only outputs first word of string

         

one_mind

1:54 pm on Oct 30, 2005 (gmt 0)

10+ Year Member



Hi,

I have a html form that has its components values set from a data base.

I have a string like so $slogan = "just do it";
And i insert it into a textbox like so:

<input type="text" name="slogan" value=<?php echo $slogan;?> >

And when i load the form the text box only shows "just" and not the "do it".

Anyone know why this is?

Thanks

jatar_k

3:01 pm on Oct 30, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



it may just be because with out quotes aroung the value the first space blows it out

<input type="text" name="slogan" value="<?php echo $slogan;?>" >

one_mind

3:25 pm on Oct 30, 2005 (gmt 0)

10+ Year Member



Yep, your a genius.

Either that or i'm stupid :)
We'll stick with the first one.

Thanks

jatar_k

3:56 am on Oct 31, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



nah, no genius I just had good teachers, I think most of them are still here ;)