designing4u.de Yet Another Coding Blog

14May/080

Class for picture upload with fix width and height

For one of my web 2.0 projects I had to develop a solution for users to upload their images with fixed width and height. Basically my customer wanted to display profile images on the start page, but the requirement was to display each of them in a div container with fixed width and height. Because I'm not a CSS guru and I didn't want to set negative background position to display only parts of the images or because of the problems, which CSS has with different browsers, I came up with a solution, which does that pretty good. My class has a simple configuration and according to the width or height of an image uploaded by a user, resizes it to predefined width or height and places it according to the case vertically or horizontally in the center. This description might be confusing right now, but if you read this post to the end I hope you will know, what I meant.

13May/085

Handeling the dates and the leap year with AJAX and jQuery

Almost all web 2.0 platforms lean toward using an existing e-mail as a form of authorization and authentication. Usually you don't need to use a user name to login or register at a certain site. What they are mostly doing though is the birth date validation. I just encountered a site, which doesn't allow a registration to the people younger than 25 years old. If you went through the registration process and you are older than 25, your re-registration process might be blocked. If you really want to register though and have enough knowledge you can delete your cookies, restart your router (or any other method depending on how you are connected to internet) and register anyway, however probably 90 percent of users doesn't have that knowledge.

6May/086

Geolocation class – retrieving longitude and latitude using google maps

A while ago I had to prepare a map for a customer. He wanted to be able to use text files with addresses and display them on the map. To be able to do that I had to find a service, which will convert a regular address into geographical longitude and latitude. What would be better than google maps to do that really simple task? I researched a little bit on google and found a really nice way, how to accomplish that.

5May/0810

Google maps and jQuery – drop down and clickable maps

I had to manage google Maps for one of the sites I was working on. Basically there were two possibilities to get the user input. Either a user was forced to use one of the drop down options to define an area of the city he or she is living in, or a user could just click on the exact spot on the map where the marker was placed.

3May/086

Login and authentication class

I lately got maybe not the best but really helpful book about object oriented programming in php5 and I decided to write my own login and authentication class. In this post I will give you a short description, how I manage the authentication of users for restricted pages. This class will use information stored in MySQL table but I will comment it out for demo purposes. I assume that you know how to use MySQL database and you will be able to create the tables by yourself. If not please let me know and I will post also the table structure.