Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Feb 15th, 2007, 5:18 PM   #1
imusion
Newbie
 
Join Date: Feb 2007
Posts: 2
Rep Power: 0 imusion is on a distinguished road
Storing HTML: What's the best method?

Well I'm building this application and I'm a little stuck right now. What I'm doing as part of my application is allowing users to write their own tutorials in the WYSIWYG editor then allowing them to submit the data from the editor into the PHP application I'm building.

What my question is what is the best way to store this data so I can display it later on and also give the users the ability to edit their tutorials in the future if they find an error?

Is storing it into a mySQL field the best? Outputting the contents into an actual file? I'm not really sure and any guidance, suggestions are appreciated!

Thanks,
John
imusion is offline   Reply With Quote
Old Feb 15th, 2007, 6:17 PM   #2
Wizard1988
Professional Programmer
 
Wizard1988's Avatar
 
Join Date: Oct 2005
Location: Chitown
Posts: 417
Rep Power: 4 Wizard1988 is on a distinguished road
Send a message via AIM to Wizard1988
How about you store the filename in mysql and just save the file like you would save any other html file.
__________________
JG-Webdesign
Wizard1988 is offline   Reply With Quote
Old Feb 15th, 2007, 6:43 PM   #3
imusion
Newbie
 
Join Date: Feb 2007
Posts: 2
Rep Power: 0 imusion is on a distinguished road
Quote:
Originally Posted by Wizard1988 View Post
How about you store the filename in mysql and just save the file like you would save any other html file.
Like I said, it's going to be an open type system where users will be able to submit tutorials into the application. Normal users don't have the ability to save the HTML file onto the server but they are just given a WYSIWYG editor to compose their tutorial.

The storage of the contents from the WYSIWYG editor is what I need to figure out.
imusion is offline   Reply With Quote
Old Feb 15th, 2007, 6:46 PM   #4
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
Store it in a file and put the filename in the DB. Oh, wait, that's what Wizard suggested.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote
Old Feb 17th, 2007, 2:09 AM   #5
Mocker
Hobbyist Programmer
 
Mocker's Avatar
 
Join Date: Oct 2005
Location: Indiana
Posts: 218
Rep Power: 0 Mocker is an unknown quantity at this point
Send a message via AIM to Mocker
I'd probably go with storing it in a file and putting the filename in the DB

OR

you could split each line of the file into its own db entry
each html record has a db entry that consists of a list of line ID's correlating to the line stored ! To get the full html you retrieve the line with the correct ID and append them together!

or you could just store it in a file and put the filename in the db
__________________
#programmingforums relay - http://thegupstudio.com/cgi-bin/pforelay.cgi
freelance scripts - http://ryanguthrie.com/index.html
Mocker is offline   Reply With Quote
Old Feb 17th, 2007, 6:56 AM   #6
Arevos
Programming Guru
 
Arevos's Avatar
 
Join Date: Aug 2005
Location: England
Posts: 1,499
Rep Power: 5 Arevos is on a distinguished road
Quote:
Originally Posted by Mocker View Post
you could split each line of the file into its own db entry
each html record has a db entry that consists of a list of line ID's correlating to the line stored ! To get the full html you retrieve the line with the correct ID and append them together!
What would be the point of doing it this way? Why not just store it in a single TEXT or BLOB field?
Arevos is offline   Reply With Quote
Old Feb 17th, 2007, 12:21 PM   #7
LOI Kratong
Professional Programmer
 
Join Date: May 2005
Location: Woo - Boot Sector!
Posts: 294
Rep Power: 4 LOI Kratong is on a distinguished road
Is your userbase really going to want to code a tut in html? I would guess no, a little gem from my latest project: Text_Wiki. It parses wikitext (easy markup) to html at run time. It may take a bit of old-school hacking/butchering to get it exactly as you want it (if you take the unorthodox method of not using PEAR, but instead just including the class), but it works a treat!

This way you can keep control of the look of the site, and the authors can keep control of the content, the way it should be :banana:
__________________
www.heldtogether.co.uk
LOI Kratong is offline   Reply With Quote
Old Feb 21st, 2007, 5:11 PM   #8
a thing
Unverified User
 
a thing's Avatar
 
Join Date: Aug 2005
Location: none
Posts: 146
Rep Power: 0 a thing is on a distinguished road
Why not just use MediaWiki?
__________________
Warning: My posts may change (dramatically) within the first 15 minutes they're posted.
Got 'Nux?—GNU/Linux and other free software support.
It's GNU/Linux, not just Linux.
a thing is offline   Reply With Quote
Old Feb 22nd, 2007, 8:40 AM   #9
Infinite Recursion
Programming Guru
 
Infinite Recursion's Avatar
 
Join Date: Jul 2004
Location: United States
Posts: 3,467
Rep Power: 8 Infinite Recursion is on a distinguished road
Send a message via MSN to Infinite Recursion Send a message via Yahoo to Infinite Recursion
Quote:
Originally Posted by Arevos View Post
What would be the point of doing it this way? Why not just store it in a single TEXT or BLOB field?
Would be a could idea to split it out, just in case there was a search feature added later, based on category, author, etc.
__________________
http://jasonpowers.net

"There are a thousand hacking at the branches of evil to one who is striking at the root."
Infinite Recursion is offline   Reply With Quote
Old Feb 22nd, 2007, 9:00 AM   #10
Arevos
Programming Guru
 
Arevos's Avatar
 
Join Date: Aug 2005
Location: England
Posts: 1,499
Rep Power: 5 Arevos is on a distinguished road
Quote:
Originally Posted by Infinite Recursion View Post
Would be a could idea to split it out, just in case there was a search feature added later, based on category, author, etc.
Usually a separate indexing table is used for these purposes.
Arevos is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to invoke static method from a Class object? smith.norton Java 1 Oct 5th, 2006 3:00 AM
Basic HTML Tutorial - Reuben Keeney ReubenK HTML / XHTML / CSS 14 Mar 26th, 2006 5:50 AM
HTML =/= Programming Sane Coder's Corner Lounge 32 Mar 8th, 2006 2:50 AM
Median/Mode in arrays? {Need help} Java|Tera Java 27 Nov 29th, 2005 10:50 AM
Debug recursion method() pr0gm3r Java 3 Oct 11th, 2005 12:33 PM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 12:43 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC