Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Regular Coder
    Join Date
    Dec 2004
    Location
    Jamaica
    Posts
    592
    Thanks
    2
    Thanked 0 Times in 0 Posts

    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

  • #2
    Senior Coder
    Join Date
    Apr 2003
    Location
    England
    Posts
    1,192
    Thanks
    5
    Thanked 13 Times in 13 Posts
    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

  • #3
    Regular Coder
    Join Date
    Dec 2004
    Location
    Jamaica
    Posts
    592
    Thanks
    2
    Thanked 0 Times in 0 Posts
    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

  • #4
    Senior Coder
    Join Date
    Apr 2003
    Location
    England
    Posts
    1,192
    Thanks
    5
    Thanked 13 Times in 13 Posts
    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)


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •