|
-
Sep 30th, 2006, 03:09 PM
#1
Thread Starter
Hyperactive Member
[RESOLVED]why only comes first word
I want to show a data in textbox from mysql database. it comes but only first word, say data is "istiaque choudhury"
it comes only "istiaque"
why?
code is
<input type="text" name="txtsellername" size=66 value=<?php echo($SellerInfo['SellerName']); ?>>
thanks for help
Last edited by samsyl; Sep 30th, 2006 at 05:54 PM.
-
Sep 30th, 2006, 04:07 PM
#2
Re: why only comes first word
because you're not using quotes around a string that has spaces in it. if you want to enclose a string for submitting to a database/form/pretty much anything, you should always have quotes around it.
Also, you can shorten your <?php echo(); ?> to <?=$var;?> to echo commands out.
PHP Code:
<input type="text" name="txtsellername" value="<?=$SellerInfo['SellerName'];?>" size="66">
In my opinion, it's good practice to put quotes around all HTML values, ie instead of size=66, you might use size="66" instead. This way, you will always avoid these types of problems.
-
Sep 30th, 2006, 05:52 PM
#3
Thread Starter
Hyperactive Member
Re: why only comes first word
-
Oct 1st, 2006, 02:00 PM
#4
Re: why only comes first word
 Originally Posted by kows
Also, you can shorten your <?php echo(); ?> to <?=$var;?> to echo commands out.
Very bad idea. This relies on the short_tags feature being enabled, but many hosts nowadays disable it because it conflicts with the use of XML processing instructions in the non-code areas. The PHP team itself strongly discourages the use of short tags.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Oct 3rd, 2006, 04:23 AM
#5
Re: why only comes first word
 Originally Posted by kows
In my opinion, it's good practice to put quotes around all HTML values, ie instead of size=66, you might use size="66" instead. This way, you will always avoid these types of problems.
And you will be XML-compatible, where there is no exception to enclosing attribute values.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|