Results 1 to 2 of 2
Thread: Minor Text Formatting
Jun 15, 2001, 07:28 #1
Minor Text Formatting
I looked over the other posts about formatting text but couldn't find anything useful. I'm not sure which or how to go about this. But here's a quick intro of what the script is suppose to do.
in the admin area. Think of "________" as a form field.
Essay Name ______________
Title of point #1______________
Title of point #2______________
What i'm trying to do is when it sends it the database it does it so it looks like this
<b>[title of point #1]</b>
<b>[title of point #2]</b>
how would i do this?
Jun 15, 2001, 07:49 #2
- Join Date
- Jun 2001
- Newcastle, England
- 0 Post(s)
- 0 Thread(s)
I'm not 100% sure what you mean - do you mean you want to write one load of data to the database? So you take whatever's entered in several form fields and combine them into a formatted whole, then store that off?
If that's what you mean, you simply need to concatenate the strings together. In the page which handles the event and writes to the database, you could just do something like this (assuming your form elements are called title1, point1 etc.):
$complete_post = "<b>" . $title1 . "</b>" . $point1 ....
Is that what you meant? An alternative would be to store in the database just what they actually typed, but when you display that data add the formatting elements. That's what's commonly done in many applications (forums, news scripts, content scripts etc.) as it means you can store their input unchanged.
Hope that covers what you were asking, if not please post again .