Welcome to HBH! If you had an account on hellboundhacker.org you will need to reset your password using the Lost Password system before you will be able to login.

A CMS (I have read the article)


NotMyFault's Avatar
Member
0 0

Ok, First thing I HAVE read the article CMS 4 Dummies on this site but I still need help. I want to build a CMS with 2 access levels: Admin and User. I am moderatly new to PHP and very new to MySQL. Question:

How should the DB be structured? I'm thinking along the lines of Username, Password and ID but I'm confused by tables and the terminology in general. Also, how can I automatically create a new user when someone clicks regeister instead of login?

Thanks


NotMyFault's Avatar
Member
0 0

Thanks, I'm only going for a very basic CMS, not something spectaculary elaborate!!! It will only be used by 10 people max.

Would Captcha be a good substitute for E-mail activation?

How would I go about making this database? Does this all go in one table or is ID one table, Rank another, Username the same etc, etc?

Sorry for my un-knowledgable-ness :right:


NotMyFault's Avatar
Member
0 0

Thanks man. Time for another crash-course on W3schools!!!


yours31f's Avatar
Retired
10 0

Go to ulmb.com. Make an account and make a DB. Then, open PHPmyAdmin and play with tables, rows, and everything.


ghost's Avatar
0 0

MoshBat wrote: You want the fields: ID, Username, Password, Email, Level, Lastvisit, Joined, Avatar, and so on.

You don't automatically add a new user, but have then fill out a form, then insert that data into the database. (Literally, INSERT) Email activation would be a good idea, too.

As for Admin/regular user, two categories may not be enough, "Level" 0 could be an Admin, and 1 a user, or vice versa.

Going off what moshbat said, here's an example table that might work (very rough, I'm no expert at this mind you):

create table users( users_pkey int(10) unsigned not null auto_increment primary key, users_username char(100) not null, users_email char(100) not null, users_level int(10) unsigned, users_lastvisit datetime, users_joined datetime, users_avatar blob (NOTE: you can also do a char here and have that be a link to their avatar) );

Then, what you're going to do with your PHP is basically have an insert that assigns the POSTs from the form to variables which will be inserted into the table. The three functions that you'll probably undoubtedly need for this will be mysql_connect, mysql_select_db, and mysql_query.

I hope that this helps you. If this seems totally foreign then perhaps consider sticking with the basics and checking out a good tutorial like http://www.tizag.com/phpT/ before proceeding to save yourself frustration.. I highly recommend that tutorial; it will walk you through the requisite skills for doing what you require.

I'm learning this stuff, probably a couple months in now myself and am having great fun with it! Good luck!


ghost's Avatar
0 0

MoshBat wrote:

Users without passwords, excellent! ;D

Haha, my bad. thanks for pointing that out though as I posted it I had a strange feeling of leaving something out…. As it's said in many a book, 'it's left as an exercise to the reader…'

:)


NotMyFault's Avatar
Member
0 0

I think you're being a bit unfair! I do learn stuff and I don't need/want things given to me. I do learn it's just when you're starting something totally new, you sometimes need some help. I amn't some skript kiddie who looks for programs to help him out or do stuff for him, I want to learn…

Anyways, I have already joined 000webhosting and set up a DB (I already knew what PHPmyAdmin was :p) But I think I'll just develop locally for the minute.


ghost's Avatar
0 0

NotMyFault wrote: I think you're being a bit unfair! I do learn stuff and I don't need/want things given to me. I do learn it's just when you're starting something totally new, you sometimes need some help. I amn't some skript kiddie who looks for programs to help him out or do stuff for him, I want to learn…

Anyways, I have already joined 000webhosting and set up a DB (I already knew what PHPmyAdmin was :p) But I think I'll just develop locally for the minute.

  1. Ignore Mosh; he's an ass.
  2. Ask as many questions as you need, but only after you've tried to find the answer yourself first.

NotMyFault's Avatar
Member
0 0

Thanks, I'm in no position to flame as this is my thread and I know my status in the community so thanks! I always try my hardest to find stuff out myself as I find I rember it much better when I find it out myself!


NotMyFault's Avatar
Member
0 0

Contary to what some people thought, I have learned enough MySQL to understand and create a very basic CMS. I'm just finishing the admin section at the minute. All I'll have to do then is make sure it's fully secure. I'll post up the code here when I'm finished it. (In case people still don't believe me :p)


NotMyFault's Avatar
Member
0 0

good point, better idea.