Jump to content

User Reviews


webdogjcn

Recommended Posts

I have no clue how I want to do this, but I am putting up some tutorials on my website and I want users to be able to write their own reviews of them. However, I am limited to one db for my whole site which means user accounts, articles, everything. Anyways I do not want to use a table for every article. I was even hoping I could have the users fill out a form and create a text file from the information and then just include it in my page. How would I do this. I am not sure where to start so if you could be as specific as possible.
Link to comment
Share on other sites

I can't think of any sensible reason to have a separate database table for each article. As well, the number of tables you can have in one database is huge (far in excess of the number of articles you'll ever write).

Despite both those, the best method is to have one table for all the articles and have an autoincremented ID for the rows and then have a second table for all the reviews - just put the articleID as one of the fields in the reviews table. Then you'll be able to pull all of the reviews for a specific article any time you want.
Link to comment
Share on other sites

okay thak you so much. I got it working.

One Last Question:
I want users to be able to post articles/tutorials on my site, but I dont want them to have to enter in stuff like "<p class=scripting></p>" to get their stuff to look right. So, I was wondering how I can process the form they send in and replace all things like [SCRIPT] with "<p class=scripting>" or [FONTCOL=blue] with "<font color='blue'>" etc. Anyways so the user would fill out a form like this:
[code]<form action=articlepost.php method=post>
<input type=text name="artname">
<textarea name="article"></textarea>[/code]
And take whatever is in "article" and replace all occurances of BB style coding with the actual html before inserting it into the db
Link to comment
Share on other sites

Instead of making it difficult for people to format articles the way they want, it might be better to use a 'smart textarea' that looks/works like a word-processor. Two excellent free such textarea editors are [a href=\"http://tinymce.moxiecode.com/\" target=\"_blank\"]TinyMCE[/a] and [a href=\"http://www.fckeditor.net/\" target=\"_blank\"]FCKEditor[/a]. Those could save you a lot of trouble.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.