By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,952 Members | 916 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,952 IT Pros & Developers. It's quick & easy.

TextArea formatting issue

P: n/a
I have a textarea that is populated from a blob within a database.
Everytime the data is pulled, however, there is always a lot of leading
space characters before the actual text. It is not in the database
this way, so how might I specify more formatting parameters within the
textarea?

Matt Williams

Jul 17 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a

"Matt" <md*******@radford.edu> wrote in message
news:11*********************@c13g2000cwb.googlegro ups.com...
I have a textarea that is populated from a blob within a database.
Everytime the data is pulled, however, there is always a lot of leading
space characters before the actual text. It is not in the database
this way, so how might I specify more formatting parameters within the
textarea?

Matt Williams


What I found was that I had a statement like....

echo ' blab blaob
'.$mytext.'
and so on'

and that spaces were added because of the line and perhaps also the
'invisible' extra space in the document on those lines after the code.

I changed it to

echo 'bla bla '.$mytext.' bla bla'

and this helped - but I am only a novice novice, so dont take it too
serious.
Jul 17 '05 #2

P: n/a
This would be my first suspicsion as well, but I entered my sample data
in the database by hand for testing purposes.......it has no extra
space appended to either sid of the text. I will try and draw what is
happening to my data
_______________________________________
| blahblahblahblahb | ^ |
|lahblahblahblahblahb | v |
----------------------------------------

Jul 17 '05 #3

P: n/a
Matt wrote:
This would be my first suspicsion as well, but I entered my sample data
in the database by hand for testing purposes.......it has no extra
space appended to either sid of the text. I will try and draw what is
happening to my data
_______________________________________
| blahblahblahblahb | ^ |
|lahblahblahblahblahb | v |
----------------------------------------


So where is the PHP code that you suspect is causing a problem?

NM

--
convert uppercase WORDS to single keystrokes to reply
Jul 17 '05 #4

P: n/a
Matt wrote:
I have a textarea that is populated from a blob within a database.
Everytime the data is pulled, however, there is always a lot of leading
space characters before the actual text. It is not in the database
this way, so how might I specify more formatting parameters within the
textarea?

Matt Williams

Make shure you put your text in the textarea as follows:
<textarea><?php print $content; ?></textarea>

and not
**<textarea>
***<?php
****print*$content;
***?>
**</textarea>

The second will produce spaces in front and at the end of $content;
--
Rutger Claes rg*@rgc.tld
Replace tld with top level domain of belgium to contact me pgp:0x3B7D6BD6
Do not reply to the from address. It's read by /dev/null and sa-learn only

Jul 17 '05 #5

P: n/a
Make shure you put your text in the textarea as follows:
<textarea><?php print $content; ?></textarea>

and not
**<textarea>
***<?php
****print*$content;
***?>
**</textarea>

The second will produce spaces in front and at the end of $content;


Not entirely, whitespace after ?> is removed.

and it should be:
echo htmlspecialchars($content);

to avoid problems with <> chars in text.

--
* html {redirect-to: url(http://browsehappy.pl);}
Jul 17 '05 #6

P: n/a
Excellent!!! This fixed the last my problems within this app. I put
the statements inline and everything looks perfectly formatted.....
Thanks

Matt Williams

Jul 17 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.