Jump to content

Very Basic HTML/PHP MySQL query that I probably should know


liam1412

Recommended Posts

2 things

 

1) Is it possible to change the font and background color of a text area.

 

2) How do you insert into a database exatcly how the text is and then rediplay as is.

 

etc

 

If I type

 

This

 

 

Is

 

 

A

 

 

Test

 

 

in a text area then insert it into my database - When I call it again it displays This is a test.

 

 

Thanks for all your help again.

Link to comment
Share on other sites

Yes! you can alter the font, and background of a text area using CSS,

 

set the class="name" in the text area parameters, and set the font/background colour etc in the css under that name..

 

as for the database, use nl2br($text)

 

example

 

you pull your information from your database, and store it as $db_info

 

when you display it (using echo or return) use echo nl2br($db_info);

 

this converts "newline" indicators to <br> for html displaying, however you dont see the <br> in the source... so if you enter it in a textbox as

 

This is

some

new

 

text

 

here

 

and submit it, if you set your database up correctly (i would say as "text" and not "varchar" (MySQL) ) then it will work fine ;)

 

Have fun, and let me know if you need any help ;)

 

again, check my blog, all the posts and comments work properly like that, i'd be happy to send you some snippets for things if you wish :)

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.