Apr
14
2010
I fixed some problems that I didn’t notice before and added a user area. This is not an update so make sure you remove the old installation (including database).
INSTALL
- Edit “bhlogin/config.php” to your server settings.
- Run the installer “bhlogin/install.php”.
- Delete “bhlogin/install.php”.
- Add the auth code to the top of your pages that you want authentication on. See “bhlogin/page.php” for an example.
I also wanted to note that this has been developed and tested on a windows PC using XAMPP and have only tested it on one other server (My GoDaddy Linux Hosting) so give feedback on how well it worked for you, any changes you needed to make. I love the feedback.
no comments | tags: auth, authentication, beta, bhlogin, easy, login, mysql, php, program, programming, script, simple
Apr
11
2010

Login Page Example
I have been working hard these past few days. Starting from scratch about 3 times to get things perfect. And yet its not at the point I would like it to be. So this would be version 1.0 of my BHLogin program. And you should consider this a beta program.
BHLogin provides a very simple way for site administrators to add user authentication to their sites. Just by adding 4 lines of code to the beginning of the page you now have a locked down page that requires user to login to see.
I am not going to go into major detail about the program because I will be making a manual and include much more support for version 2.0 but I can at least tell you how to get started.
You can start by downloading one of these amazing archives.
Start by extracting one of these archives onto your site.
Open “bhlogin/config.php” and edit the settings to work with your server.
Open a web browser and run “bhlogin/install.php”.
After install is done with no errors, delete “bhlogin/install.php” so nobody can mess with your installation.
You can now login to “bhlogin/admin/” as User:admin, Pass:admin to change your username and password, create new users, and delete users.
If you visit “bhlogin/page.php” you will see that you are required to login to view that page. If you open that page in your favorite text editor you will see the code that looks like this:
<?php
// Start basic session handleing
session_start();
// Load bhlogin.php
require (‘bhlogin.php’);
// Load bhlogin class
$bhlogin = new bhlogin();
// Require authentication
// auth($auth_level, $page = NULL)
// $auth_level can be 1 = User, 2 = Manager, 3 = Administrator
// $page can be left blank and $after_login (in config.php) will be used instead. This is the page to redirect to after login.
$bhlogin->auth(1, $_SERVER['REQUEST_URI']);
?>
This code is required to add authentication to your pages. I added comments so you can see what is what.
Let me know what you think in the comments below.
Plans for version 2.0
- Allow users to sign up
- Allow users to change their settings
- Verify email with link emailed to user
- Ability to email a user from the admin panel
- Anything else I can think of.
There is still lots of work to do. But I am hoping to be done it before I leave for Basic Training.
no comments | tags: auth, authentication, beta, bhlogin, easy, login, mysql, php, program, programming, script, simple
Apr
8
2009
I just made a quick program to help me find colours of things that are on my screen. What it dose is when I press the hot key it gets the colour of the current pixel that my mouse is over. It pops up saying the colour code in the HEX format then copies it to the systems clipboard. I needed something that for a while then I decided to create one as I could not find one. I use the hex code for making webpages. It has saved me a lot of time because now I don’t need to look back into code to find out what the exact colour is of areas on the site. Very handy if you are creating a page add-ins, like google ads.
In the end I decided to share it with all of the developers out there that need something like this. I used AutoHotKeys and included both the source and compiled version in the download.
Here is the description that I used on my site.
The HEX Color Getter is a program that I made in auto hot keys that allows programers or website developers to figure out what the colour is of the current pixle that the mouse is over. To use it just start the program, you will see a little H with a green background in your taskbar. When you want to figure out what the colour is of a specific pixle on your computer screen (works on multi monitor setups) press Ctrl + Alt + Z. You will see a dialog box pop up and once you close the box it is automaticly sent to the computers clipboard. Now just paste it into your program. Note that you may need to append a # or 0x infront of it as its just the hex numbers on its own. This program includes both the source and a compiled version. The program lisenced under a Creative Commons Attribution 2.5 Canada License.
You can download it now from my project page.
HEX Color Getter
no comments | tags: color, colour, hex, made by me, new, program
Feb
19
2009
Our school is one of the few in Ontario that are trying to become an eco-school. We have been a silver eco-school as of last year and this year we are trying for the gold.
In Academic Resources there is a sign-in system. When you come into the room you must sign your name on the sheet. The problem with this system is that it uses a lot of paper and most of which is just thrown away. It was a teacher in AR that had the idea of having an electronic sign-in system using excel. After seeing it while he was still making it I just about cried by how difficult it would make things for entering and leaving the room. I decided that during my spare I would sit in AR and write a neat and user friendly php/mysql program on my laptop. For those that now what these are you would also know that you need a web server, I used xampp lite just because everything was in one place and I could run it from my USB drive.
Here are the functions of the sign-in system.
I had a nice looking home page that everyone would see when they go to sign-in. This page has three buttons, a door with the words sign-in below, a door with the words sign-out below, and a button almost invisible in the top right that says Administrator (need user and pass).
When a student would come in they would click on the sign-in door. They would do a search for their last name. If they are not in the list they can create their self (just first and last name). If they are in the list they would enter why they are here. Once submitted it is automatically time stamped and stored in the database.
When a student is going to leave they would click the sign-out door, find their name from the list of signed in students and sign-out. Again once submitted the sign-out time is automatically tracked and stored to the database.
Teachers could easily access all of this information and more from the administrator panel. Stuff like student list and a mass sign-out function for students who forget to sign-out (like me).
As I was working on this I was also learning more about PHP and a week of working on this went by and after I was done I showed the head of AR. She loved it and wanted it setup now. We setup a time to talk to the LAN tech to see if he can setup a computer at the door.
Here is the kicker. I never even showed him the program. As the computer was starting up I was explaining how I did it and what I used. When I told him that I used xampp lite he flipped out and said no servers even if its on a stand alone system (off the network).
So in the end I was learning against the the rules and I also wasted a week of my life.
no comments | tags: easy, education, illegal, mysql, php, program, restrictions, school, server, tech, tony, usb