Redirect according to browser language: mod rewrite and HTTP_ACCEPT_LANGUAGE

.htaccess, apache, mod-rewrite Comments (13) »

I wanted to redirect users to the main page of the website according to his/her browser default language setting.
This setting is sent by the browser at every request to the server as ‘Accept-Language’ header and can look like this “pl,en-us;q=0.7,en;q=0.3″. You can check it with Live HTTP Headers Add-on for Firefox and read more about [...]

How to calculate in MySQL average value of data in a row?

mysql Comments (8) »

When programming some voting system I wanted to count in MySQL average of values inserted in one row. If I had data in a column and wanted to return average I would have used the AVG() function but I wanted to return average from a row.
You can say – where is the problem? Let’s sum [...]

Why yet another PHP/MySQL blog?

common Comments (84) »

That’s a very good question! I know there are tons of information about PHP, MySQL and Apache but somehow finding answers to some questions is very difficult or even impossible. And when you don’t have a ready answer then you have to discover it by yourself. That’s why I created this blog – for sharing [...]

Engine: Wordpress.
Log in