This is a discussion on Help a Newbie - MySql Result in textarea within the PHP Language forums, part of the PHP Programming Forums category; I have a script to display mysql query results in a table. I'd like to display the results in ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
On 2004-01-13, MrWium <mrwium@yahoo.com> wrote:
> I have a script to display mysql query results in a table. I'd like to > display the results in a scrollable textarea. Is there a way to do > this? TIA You need a group about (x)html and/or css. textarea { overflow: scroll; } -- http://home.mysth.be/~timvw |
|
|||
|
MrWium wrote:
> I have a script to display mysql query results in a table. I'd like to > display the results in a scrollable textarea. Is there a way to do > this? TIA Certainly. Just make sure to escape the data carefully. I use something like this: echo "<textarea rows=\"8\" cols=\"45\">"; if(isset($existingvalue)) echo htmlspecialchars(stripslashes($existingvalue)); echo "</textarea>"; That will put the value of the variable into a textarea, as used in a form. If you don't want a form object, go find out about the iframe element (though I don't like the iframe element much). Otherwise you'll need to use JavaScript (evil, evil) to write a scrolling layer object to put text into. And that will be guaranteed to not work on most browsers (did I mention that JavaScript is evil?). -- Bob London, UK echo Mail fefsensmrrjyaheeoceoq\! | tr "jefroq\!" "@obe.uk" |
|
|||
|
Robert Downes <nospamplease@see.my.signature.con> wrote in message news:<40046b7e$0$61071$65c69314@mercury.nildram.ne t>...
> MrWium wrote: > > I have a script to display mysql query results in a table. I'd like to > > display the results in a scrollable textarea. Is there a way to do > > this? TIA > > Certainly. Just make sure to escape the data carefully. I use something > like this: > > echo "<textarea rows=\"8\" cols=\"45\">"; > if(isset($existingvalue)) > echo htmlspecialchars(stripslashes($existingvalue)); > echo "</textarea>"; > > That will put the value of the variable into a textarea, as used in a form. > > If you don't want a form object, go find out about the iframe element > (though I don't like the iframe element much). Otherwise you'll need to > use JavaScript (evil, evil) to write a scrolling layer object to put > text into. And that will be guaranteed to not work on most browsers (did > I mention that JavaScript is evil?). Thanks to all for the help. All the best. Mr. Wium |