Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   PHP (http://www.programmingforums.org/forum29.html)
-   -   Storing HTML: What's the best method? (http://www.programmingforums.org/showthread.php?t=12585)

imusion Feb 15th, 2007 6:18 PM

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

Wizard1988 Feb 15th, 2007 7:17 PM

How about you store the filename in mysql and just save the file like you would save any other html file.

imusion Feb 15th, 2007 7:43 PM

Quote:

Originally Posted by Wizard1988 (Post 123990)
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.

DaWei Feb 15th, 2007 7:46 PM

Store it in a file and put the filename in the DB. Oh, wait, that's what Wizard suggested.

Mocker Feb 17th, 2007 3:09 AM

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

Arevos Feb 17th, 2007 7:56 AM

Quote:

Originally Posted by Mocker (Post 124045)
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?

LOI Kratong Feb 17th, 2007 1:21 PM

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:

a thing Feb 21st, 2007 6:11 PM

Why not just use MediaWiki?

Infinite Recursion Feb 22nd, 2007 9:40 AM

Quote:

Originally Posted by Arevos (Post 124051)
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.

Arevos Feb 22nd, 2007 10:00 AM

Quote:

Originally Posted by Infinite Recursion (Post 124260)
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.


All times are GMT -5. The time now is 2:01 AM.

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