Posts: 21 Technical: 9 Comments: 2

Technical on kobaj.net

by: kobaj at 2010-01-03 10:00:21

For those 2 readers that wonder what makes kobaj.net tick, I'll go over some of my code implemented, and a brief history. Keep your pants on.
To begin, a brief history.
**********
Kobaj.gotdns.com was my original domain way back in 07 I think. Waybackmachine doesnt work with my site so I havnt a clue of the true first time I tried HTML. Speaking of which, the very first site was entirely xHTML and infact I was very proud to be xhtml certified. It went through a couple of revisions to get CSS certified as well.

Site number 2 was one of the fastest I ever wrote, it was part HTML and part PHP, and I had finally gotten the real domain kobaj.net. While it survived as my site for some time, it was horribly inefficient and terrible to update, so it came down. I also dropped certification as almost every time I updated, I would no longer be certified - and re-certification process takes too much time.

Around 2008 I worked on my third website, and was the best yet. PHP, MySQL, HTML and CSS were all used in conjunction to bring about a rather pleasant site that looked great for the user. However, the administrative side and security leaks eventually caused me to rebuild yet again. The third site was also a joint venture with some friends where anyone could update anytime. This lead to chaos on my end, and am now the only moderator again.

Here are are with the 4th of my websites. Hard to imagine but this entire website is encapsulated in just one file. Nearly 1000 lines of PHP code (976 lines last I checked) are combined with HTML MySQL and CSS to produce the stunning website before you. While administratively it's still not perfect, I'm very proud to have comments, posts, blogs and more wrapped up in the tightest security yet, all on my site without using dedicated systems like wordpress.

I've always hosted on my own home server running Apache since the very first website.

Some code! (actual code not supplied because its boring and if you truly wanted it, you would have it already)
**********
The first 200 lines or so are actually HTML and CSS, defining how the site looks. I could have made it a dedicated file - but that wouldnt stick with my 'make it all one file' ideology. Plus this way it's super easy to modify (oh irony!).

The next 100 or so define variables, I like a C# approach and make everything a global.

Next 100 Define the basic layout. Query where the user is based on the URL or Gets or Posts variables - then directs them to the appropriate function.

The next 400 anyone but me will probably never use! Its all admin code, different queries that I can execute to delete, modify, add, etc posts.

Finally, the last 100 200 is what the user actually sees. This is the code showing posts and comments and links and things.

My favorite part of this whole ordeal, the user only sees maybe 25 lines of html...total...ever, as PHP is executed on the server.
Comments: 0
Name*:
Email* (wont be shown):
Post*:

* Denotes required field. URLs are not allowed in comment post.

CopyRight Kobaj Code and Design 2009 - 2010