View Full Version : Forum Creation Problem

01-06-2005, 06:34 PM
I have designed a system where in there is a group of 6 users of the system. It has a forum, where the users should be allowed to post to the forum and I want to also include the functionality that members of the public can also participate in the forum.

The forum table that I have designed in access has two fields that concern me; a "username" field and a "outsiderPost" field so that when a user adds data to the table, his username is stored in the table and when a member from the public adds their name is stored in the outsiderPost field

I have linked the forum table to the users table so that when i delete a user, the instances of the user posts are also deleted.

But if a member of the public adds to the forum, i get an error from the browser saying that a field is required in the "users" table, which I understand. But then I can do save the record if i open the database and only put in the outsiderPost field and supply the relevant data without the username. How come?

I can leave out the username when i manually open the database, but I cannot do the same thing with ASP coding

01-07-2005, 03:39 PM
i usually put a guest account in the users table, (id=1 or whatever) and dont actually set up a relation between the poster_id [posts] and id [users] but add another field to posts that stores a short guest's name (15 chars or whatever).. if the poster's id is 1 then it shows their guest name in italics, otherwise it just shows the username of the poster's id

01-09-2005, 04:23 PM
Thanks for your help but the thing is I don't think that'd do.... bcoz the thing is puttin them in that table would grant them access to a host of other things and priveleges that are available to only the group members....
that is:
administrative priveleges such as deleting from the guestbook, deleting posts in the forum, deleting announcements, confirming invitations.... u catch my drift and i really do not wanna go through the stress of including WHERE username<>"guest" in every sql line of code and other if statements that I have used....
But i'll keep thinking though. Thanks for the help tho :thumbsup:

01-11-2005, 02:02 PM
i just simulate a login for guests and set a global variable (well.. i put it in an include file that is at the top of every page)
you shouldnt need to modify any where clauses or anything, the administrative pages must have a condition that stops guests from using them if they type in the url directly, ie change
if(logged in) to if(adminlevel > 1)