Misc Links
Forum Archive
News Archive
File DB
 

Ads
 

Advertisement
Age of Valor - Ultima Online Free Shard
AoS/SE/ML/Custom - advanced code, dedicated staff, peerless bosses, non overpowered customs + much much more
 

Latest Forum Topics
Possibly shutting down forum in near future
Posted by Red Squirrel
on Jan 21 2012, 5:19:43 pm

How to solve "ZoneMinder Console - Stopped"
Posted by Red Squirrel
on Jan 14 2012, 12:28:31 am

had fun on last day of 2011
Posted by rovingcowboy
on Jan 01 2012, 5:30:47 pm

Merry Christmas!
Posted by rovingcowboy
on Jan 01 2012, 5:11:32 pm

How to solve SMF directory not writable
Posted by Red Squirrel
on Oct 15 2011, 12:03:38 am

 

Creating your own content management system with php
Better control of site content and access
By Red Squirrel


Since the examples did not use mysql, I figured I would show a real time example of a login system that does use mysql, since you now know the basics of login systems, and probably know mysql if you read my php data storage tutorial, I won't go in as much detail but rather point out the main parts.



1: We do the usual mysql stuff, those vars are simply stored in some other file and well, the values are none of your business. :P

2: The query checked to see if a user matched with the username and password given so if there's 1 result, we keep going, but if there's 0 results, then we do stuff. Usually we'd give a chance, but since only admins use this particular system we're more strict.

3: Since the user got the password wrong, we block him off, don't mind what that function does, since it's one I made and use in that script, normally you would display a "bad username/password" message.

4: This is really interesting. Basically we want to generate a random string that we will use for the session string. But to make it super unique, we just MD5 a bunch of stuff together, including the IP address and random numbers, then make a super long string. The possibilities are endless here, just have fun!

5: Then we put the cookie (this is why doing the auth stuff before data output is a must) and also update the user record with that session.

6: Then we're ready to do whatever we want to do once we're logged in! There better not be security exploits in this since I'm screwed. :P

Well this ends the tutorial. I hope that you learned something from it. And with the knowledge gained from this article and my other php related ones, you should be able to make a rather advanced CMS system if you put all those skills together.

If you're wondering out of curiosity how this site is run, it is actually a very different system. Each page is somewhat independent of each other in terms of html. There are various reasons for this, one of them is that it is more flexible in terms of ad placements, as I can put different ads on different pages as easly as it would on fully static html pages.

This is something you should ask yourself, do you really need a CMS, or do you simply want to plug in php code in html pages? A full featured CMS where you can add modules etc and different sections is cool and all, but if you don't really need it, then stick with static html and php where needed.

But if you need to be able to password protect stuff, and make it easier to change the look then a CMS is the way to go, and coding it yourself is a good start.

Red Squirrel
IceTeks Owner




spacer
16789 Hits Pages: [1] [2] [3] [4] 1 Comments
spacer


Latest comments (newest first)
Posted by Andy on October 10th 2004 (08:52)
LOL I was about to say. WOW this guest is smart. Why can't i find someone like that at my site. laugh.gif
spacer
View all comments
Post comment

Age of Valor Ultima Online Server

Top Articles Latest Articles
- What are .bin files for? (27968 reads)
- Text searching in linux with grep (22573 reads)
- SPFDisk (Special Fdisk) Partition Manager (17074 reads)
- Creating your own content management system with php (16789 reads)
- PSP User's Guide (16566 reads)
- How to Use MDADM Linux Raid (14858 reads)
- What is Cloud Computing? (14887 reads)
- Dynamic Forum Signatures (version 2) (15256 reads)
- Successfully Hacking your iPhone or iTouch (15921 reads)
- Ultima Online Newbie Guide (16385 reads)
corner image

This site best viewed in a W3C standard browser at 800*600 or higher
Site design by Red Squirrel | Contact
© Copyright 2012 Ryan Auclair/IceTeks, All rights reserved