Home

Hi there, I am Nalle!

I'm from Stavanger, Norway, if you should wonder.

The dog in my lap is Pelops - He's a four years old Chihuahua, born in Greece.

These are my pages, and I will use them to profile Open Source, share program examples that I make and the solution for a few programming headaces I've been having.

 

I will also tell you a bit about myself - just a bit, so you'll have a feeling of who I am.

Programming

Menu:

     How to make a simple counter in PHp/MySQL      Database and session based login in PHP/MYSQL    
     Thanks to      

 

Database and session based login in PHP/MYSQL

To login using a database and session login makes user handeling easy. This version does not have encrypted passwords, but you do need access to the database to find the password.
This login system have no «Forgot passwords?» - part, but I will make one later that can do that. The licence for this one is GPLv2.

This counter uses a database table named «users» and I will not explain that here, but the table is going to have the following caracteristica:

Name Data type Length Default Key Note
ID INT 1 Auto Increment Primary Key  
name VARCHAR 255 No default   So you can get the name of the user and use that in yout app
username VARCHAR 255 No default    
password VARCHAR 255 No default    

For a intermediate PHP programmer, this should be a breeze. Just remember that the code in the yellow box to the right must be in the beginning of every page or handler you make to secure the page.

Code that must be in the beginning of every file that's to be secured!
				
<.?php # Remove the dot before the question mark.
   session_start();
    $session_username = $_SESSION['session_username'];
    if($session_username == "")
             {
                  header("Location: ./");
             }
?>

I have prepared a .zip file to download for you, containing all code you need to make the login system work (well, you will have to create the table).
Yo can download the file here: SessionBasedLogin.zip.

I have also prepared a tiny demo, that you can try out here: SessionBasedLogin Demo.
The file should be quite well documented in the code. It also contains a secure and easy way to open databases.

 

Hope you enjoy the login-script


 

 

 

How to make a simple counter in PHP:

This counter uses a database table named «counter» and I will not explain that here, but the table is going to have the following caracteristica:

Name Data type Length Default Key
ID INT 1 Auto Increment Primary Key
count VARCHAR 25 No default  

The script assumes that you allready have opened the database.

Download counter-script.zip and use it, change it.
And if you wonder what it looks like - well look below, but I've removed the start date, since that's my start date and it would be wrong for you.

License? I think I'll make it public domain - use it if you need it and have fun!

 

 


Thanks to:

Open source

I am a huge fan of anything open, like open source, open hardware and open standards. Ideas are to be shared, giving incentive to even better ideas that you then would get back as a trade for you sharing your ideas.

I am not agains patent as such, but to patent ideas and thoughts should not be legal. If you got an item in your hand that you have invented, patents will protect you from other selling cheap copies of your invention.

That does not however, translate into patents on software. People that try to solve the same problem, will from time to time find a similar solution. That's not copying! That's good thinking.

Now when it comes to open hardware, thats an entirely other business. Have your patent on the hardware. I endorse that noe houndred percent! But I (or someone else that actually is able to) want to make programs and drivers for that hardware. And it's there the openness comes in. The programmer that makes the driver just want more people to be able to use your unit, and that I mean should be possible at all times. So release the specs and APIs! What have you got to loose? They are (if you look at it that way, and I do) after all working for you - making the driver that make you sell the unit to even more people.

Links to good free software:

Program Name Description Web Site
LibreOffice

LibreOffice is a powerful office suite; Its clean interface and its powerful tools let you unleash your creativity and grow your productivity.
LibreOffice embeds several applications that make it the 
most powerful Free & Open Source Office suite on the market

LibreOffice is a «fork» of OpenOffice.org, with word processor, spread sheet, presantation program and more. Fully compatible with MS Office's formats.
https://www.libreoffice.org/
The Gimp GIMP is the GNU Image Manipulation Program. It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages. (more...) http://www.gimp.org/
Truecrypt TrueCrypt is software for establishing and maintaining an on-the-fly-encrypted volume (data storage device). On-the-fly encryption means that data is automatically encrypted right before it is saved and decrypted right after it is loaded, without any user intervention. No data stored on an encrypted volume can be read (decrypted) without using the correct password/keyfile(s) or correct encryption keys. Entire file system is encrypted (e.g., file names, folder names, contents of every file, free space, meta data, etc). http://www.truecrypt.org/
Mozilla Firefox

Browsing Made Easy
Get to your favorite sites quickly – even if you don’t remember the URLs. Type your term into the location bar (aka the Awesome Bar) and the autocomplete function will include possible matches from your browsing history, bookmarked sites and open tabs.

Improved Interface
We’re always looking for ways to make your browsing easier and more efficient.

https://www.mozilla.org/en-US/firefox/features/
Mozilla Thunderbird Thunderbird is a free email application that's easy to set up and customize - and it's loaded with great features! https://www.mozilla.org/en-US/thunderbird/
FileZilla FileZilla, the free FTP solution. Both a client and a server are available. FileZilla is open source software distributed free of charge under the terms of the GNU General Public License https://filezilla-project.org/
Notepad++

Notepad++ is a free (as in "free speech" and also as in "free beer") source code editor and Notepad replacement that supports several languages. Running in the MS Windows environment, its use is governed by GPL License.

Based on the powerful editing component Scintilla, Notepad++ is written in C++ and uses pure Win32 API and STL which ensures a higher execution speed and smaller program size. By optimizing as many routines as possible without losing user friendliness, Notepad++ is trying to reduce the world carbon dioxide emissions. When using less CPU power, the PC can throttle down and reduce power consumption, resulting in a greener environment.
 
CCCP The Combined Community Codec Pack is a simple playback pack for Windows with the goal of supporting the majority of video formats in use today. http://www.cccp-project.net/
Avidemux Avidemux is a free video editor designed for simple cutting, filtering and encoding tasks. It supports many file types, including AVI, DVD compatible MPEG files, MP4 and ASF, using a variety of codecs. Tasks can be automated using projects, job queue and powerful scripting capabilities.

Avidemux is available for Linux, BSD, Mac OS X and Microsoft Windows under the GNU GPL license.
http://avidemux.berlios.de/
Linux Linux is a Unix-like and POSIX-compliant computer operating system assembled under the model of free and open source software development and distribution. The defining component of Linux is the Linux kernel, an operating system kernel first released on 5 October 1991 by Linus Torvalds. Read more... Distribution of Linux
http://distrowatch.com/

 

 

About Nalle

Before I worked with Computers.

I was born 11th of September 1965. As a pre-school kid I played around the house and my mother was at home, taking care of five children.

Dad was working at a shipyard first, then as a caretaker. He died when I was six.

My mom had to take care of all us five children aged from six to fifteen - not an easy job, but she handled it somehow. Se worked as a waiter, so she often worked evenings, so I was often looked after by my older sisters and brothers.

I startad at school at «Berg barneskole», when I was seven, and when I was 12, I started at «Blussuvoll ungdomsskole», where I was for three years.

Then I went to «Trondheim Kokk og stuertskole», where i trained to be a chef.
Three years later, after working as a chef in Skien, I went to «Sandefjord kokk og stuertskole» to get my diploma as chef.
I got my diploma in June 1985.

I worked as a cook in different kitchens until 1991. Then my shoulders and joints couldn't take it anymore.

I started school again in 1992 and used three years becoming a Nourishment tecnichian.

In 1993 my mum died.

I finished school in 1995 and worked about a year as forman at a tomato and cucumber gardnery.

 

After I started working with computers:

While working with cleaning of the greenhouses, making them ready to next years crop, a friend of me that knew I was interested and quite good with computers called me and asked if I wantet a job in bubble support, as a company was upgrading from Windows 3.51 to Windows 95 OSR2.

I went to an interview and didn't get the job. However I got called back a few days later, they needed someone anyway, so they asked if I could be to Cristmass. I could.

Then they asked me for 14 days more, since the one they had at one of their ship-building projects had some trouble. I quickly fixed the small problems and it ended with me being there for two years until the project was done.

After completing the project I worked as a SMB (Small Medium Business) consultant. I continued doing that for eight years till 2008, when I worked 1 ½ years at an oil equipment comapny. There I worked with personal client support, something I've found is the thing, part from programming, I do the best.

That project came to an end when the site I worked on got merged into the main company when their new building was done.

After that I ran my own company, doing all types of support maintenance and programming for the SMB segment. I liked working like that.

In 2011 - 30th of July, I was on my way to work, when a car with an intoxicated driver, without drivers licence and with a car he had stolen from his dad, hit me so hard that i got three teeth crushed and a double Spinal disc herniation. After two operations, I am still so full of pain and have so big problems concentrating because of that, that I cannot work anymore.

 

 

 

Other stuff:

I have two daughters and a chihuahua. No wife anymore.

I have, however a house in Greece, that you can see to the left here.The house is bordering to a nice little place about as far south as you can get on Pelleponese, close to Koroni. The place is called Vasilitsi (se sign above). I am rebuilding it as fast as I can affoard, and hope to have it ready in two or three years. Well not ready - in a house that's ready, lives a man without imagination. I hope to have it so ready that I can live there. I can't do that yet.

I am an animal friend. I got two guinea pigs and a dog myself and a bird feeder for the little birds outside. Yoy see my dog Pelops at http://www.pelops.no/

 

 

 

 

 

 

Contact me

Nalle Berg
Dr. Græslis vei 8
4011 Stavanger
Norway

Phone: +47 408 45 145

 

 

This is where I live:

 



You are visitor 763 since it's creation at the 6th of April 2014.