View Full Version : Adding Category For PHP Forum Creation?

08-10-2012, 12:00 PM

I am making a forum with PHP so far this is what I have http://admintalk.net Now how do I add a category feature so all forums are in a specific category??

The code can be accesed here

I am currently learning so all this this code is open source whilist i learn.

I also want to make a feature where if a user is a admin, On the a permission table then dont display the forum or allow access to forum threads how can this be done?

Been Working Hard going though this proccess think ive done great so far,



08-10-2012, 04:48 PM
The users table needs a username AND encrypted password.
Also a column for 'userLevel'. I see now you just log in with a username.

You'll need a column in the table that stores the posts ... a column for "category".


What you're doing is a great way to learn PHP/MySQL, but a daunting task
to actually make a secure and efficient forum. I'm suspecting that your
MySQL database is not normalized correctly either:

I also see you're not even sanitizing strings being put into your database:

Not trying to be picky, but security, validations, structure, user registrations,
are things that you need to address at the beginning of your project.

I would never have the guts (nor time) to attempt creating my own forum.
So, I admire your passion for this.


08-11-2012, 07:44 AM
Yeah i know there some sql injected thongs that I will fix as soon as i can..

And how does Mybb or vbulletin make category linked with forums

Len Whistler
08-11-2012, 08:50 AM
Now how do I add a category feature so all forums are in a specific category??

category_id | category
01 | Fishing
02 | Holidays
03 | Hiking
04 | Bikes

forums_id | title | category_id
001 | Biking Tips | 04
002 | Summer Fun | 02
003 | Trails | 03
004 | Boots and Gear | 03
005 | Mexico | 02
006 | Fishing Tackle | 01
007 | Buying Wheels | 04

Primary Key = Bold
Foreign Key = Italic