Go Back   CodingForums.com > :: Server side development > ASP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 01-06-2005, 06:34 PM   PM User | #1
jaywhy13
Regular Coder

 
Join Date: Dec 2004
Location: Jamaica
Posts: 592
Thanks: 2
Thanked 0 Times in 0 Posts
jaywhy13 is an unknown quantity at this point
Exclamation Forum Creation Problem

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
jaywhy13 is offline   Reply With Quote
Old 01-07-2005, 03:39 PM   PM User | #2
ghell
Senior Coder

 
Join Date: Apr 2003
Location: England
Posts: 1,192
Thanks: 5
Thanked 13 Times in 13 Posts
ghell is on a distinguished road
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
__________________
My tech/code blog
ghell is offline   Reply With Quote
Old 01-09-2005, 04:23 PM   PM User | #3
jaywhy13
Regular Coder

 
Join Date: Dec 2004
Location: Jamaica
Posts: 592
Thanks: 2
Thanked 0 Times in 0 Posts
jaywhy13 is an unknown quantity at this point
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
jaywhy13 is offline   Reply With Quote
Old 01-11-2005, 02:02 PM   PM User | #4
ghell
Senior Coder

 
Join Date: Apr 2003
Location: England
Posts: 1,192
Thanks: 5
Thanked 13 Times in 13 Posts
ghell is on a distinguished road
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)
__________________
My tech/code blog
ghell is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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


All times are GMT +1. The time now is 03:39 AM.


Advertisement
Log in to turn off these ads.