Follow us on Twitter!
The measure of a mans life is not how well he dies, but how well he lives.
Thursday, April 17, 2014
Navigation
Home
HellBoundHackers Main:
HellBoundHackers Find:
HellBoundHackers Information:
Learn
Communicate
Submit
Shop
Challenges
HellBoundHackers Exploit:
HellBoundHackers Programming:
HellBoundHackers Think:
HellBoundHackers Track:
HellBoundHackers Patch:
HellBoundHackers Other:
HellBoundHackers Need Help?
Other
Members Online
Total Online: 23
Guests Online: 21
Members Online: 2

Registered Members: 82815
Newest Member: medjiking
Latest Articles
View Thread

HellBound Hackers | Computer General | Webmasters Lounge

Author

A CMS (I have read the article)

NotMyFault
Member

Your avatar

Posts: 68
Location:
Joined: 23.12.09
Rank:
Newbie
Posted on 01-03-10 18:31
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





Edited by NotMyFault on 01-03-10 18:31
Author

RE: A CMS (I have read the article)

NotMyFault
Member

Your avatar

Posts: 68
Location:
Joined: 23.12.09
Rank:
Newbie
Posted on 01-03-10 19:27
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:




Author

RE: A CMS (I have read the article)

NotMyFault
Member

Your avatar

Posts: 68
Location:
Joined: 23.12.09
Rank:
Newbie
Posted on 01-03-10 19:43
Thanks man.
Time for another crash-course on W3schools!!!


Author

RE: A CMS (I have read the article)

yours31f
Member



Posts: 1678
Location: Dallas Texas
Joined: 27.04.07
Rank:
Elite
Posted on 02-03-10 00:47
Go to ulmb.com. Make an account and make a DB. Then, open PHPmyAdmin and play with tables, rows, and everything.


Debugging is what programmers do to beta software to make it take up more room on your hard drive if it is running too efficiently.


img259.imageshack.us/img259/3713/sigr.png

yours31f@live.com yours31f@yahoo.com rpwd.info
Author

RE: A CMS (I have read the article)


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 02-03-10 04:06
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!
Author

RE: A CMS (I have read the article)


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 02-03-10 04:27
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...'

Smile
Author

RE: A CMS (I have read the article)

NotMyFault
Member

Your avatar

Posts: 68
Location:
Joined: 23.12.09
Rank:
Newbie
Posted on 02-03-10 18:32
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 Pfft) But I think I'll just develop locally for the minute.


Author

RE: A CMS (I have read the article)


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 03-03-10 13:18
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 Pfft) 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.


Author

RE: A CMS (I have read the article)

NotMyFault
Member

Your avatar

Posts: 68
Location:
Joined: 23.12.09
Rank:
Newbie
Posted on 03-03-10 20:01
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!


Author

RE: A CMS (I have read the article)

NotMyFault
Member

Your avatar

Posts: 68
Location:
Joined: 23.12.09
Rank:
Newbie
Posted on 05-03-10 17:35
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 Pfft)


Author

RE: A CMS (I have read the article)

NotMyFault
Member

Your avatar

Posts: 68
Location:
Joined: 23.12.09
Rank:
Newbie
Posted on 05-03-10 17:43
good point, better idea.