Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

The Database Forum


You are currently viewing our The Database Forum as a guest. Please register to participate.
Login



Reply
Can I upload text as HTML to a database?
Old 04-13-2005, 10:20 PM Can I upload text as HTML to a database?
brokensoul2271's Avatar
- - - - - - - - -

Posts: 750
Location: Lancashire, UK
Trades: 0
I was wondering if it was possible to include a form in my website that uploads text from a text field as a HTML file into a directory so that I can link to from my archive.

I would like to be able to let my visitors upload their poetry/lyrics with out submitting it by email and so that its easier to include in my site. It needs to include all the link breaks without me needing to edit it. It also needs to be able to disallow html tags and and other scripting language.

Basically it needs to be something like a blog or forum post, if you understand what I mean.
So that users just type in their text, submit it and its added to a directory as a html file in the same format its writen in.

Any help would be appriciated
__________________
Yes, indeed...

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
brokensoul2271 is offline
Reply With Quote
View Public Profile Visit brokensoul2271's homepage!
 
 
Register now for full access!
Old 04-14-2005, 12:23 PM
0beron's Avatar
Defies a Status

Posts: 1,832
Location: Somewhere else entirely
Trades: 0
Do you want to allow any kind of formatting, or do you just want text with line breaks?
If so you can use a text area, feeding into a database field of type TEXT, but before you put it in to the database, (or after it comes out) you call nl2br() on the text, which results in all the newlines (\n) being replaced with '<br />' and the line breaks appearing on the page.

If you want to have links or color tags or anything, it gets more complex and you'll either need to do it yourself with regexs or go and pinch some code from a blog or forum script .
__________________
UPDATE 0beron SET talkupation = talkupation + lots WHERE post = 'helpful';

Please login or register to view this content. Registration is FREE
(aka MSN handwriting for forums)
0beron is offline
Reply With Quote
View Public Profile Visit 0beron's homepage!
 
Old 04-14-2005, 12:31 PM
brokensoul2271's Avatar
- - - - - - - - -

Posts: 750
Location: Lancashire, UK
Trades: 0
Thanks. I wont be doing it for a bit yet as I'm still learning the fundementals of PHP/MySQL. I just wanted to kno if it was possible so I could start building the database. I dont need it to be formated but I presume I can set stylesheets on that file or upload it with a template?

Thanks again!
__________________
Yes, indeed...

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
brokensoul2271 is offline
Reply With Quote
View Public Profile Visit brokensoul2271's homepage!
 
Reply     « Reply to Can I upload text as HTML to a database?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.18303 seconds with 12 queries