This is a short article on how to best implement the Facebook PHP SDK for two integration methods: Canvas applications and external websites offering Facebook Login to their visitors. The difference is not very well documented in the example provided with the SDK. Read the rest of this entry »
Just a quick note on character encoding in MySQL, use the following to force MySQL into using UTF-8 for ever!
In your PHP, always use the following immediately after you set up your connection.
- mysql_set_charset(‘utf8′, $oDB);
- mysql_query(‘SET NAMES \’utf8\”);
The tricky bit lies in your MySQL configuration file:
Add the following lines:
[client] default-character-set=utf8 [mysqld] default-character-set=utf8 default-collation = utf8_general_ci
This tells MySQL that the client (which is either PHP or the system) expects UTF-8. If you don’t tell MySQL this, a mysqldump will produce ANSI and an import from the command line will result in double encodings.
And don’t forget to use utf8_general_ci for all databases, tables and fields!
They are the nightmare of every PHP programmer: unknown characters suddenly showing up on your pages. The basic workaround is to htmlentity-encode everything. But one day you’ll get fed up with this dirty work-around and will want to get to the bottom of the problem. That’s what happend to me yesterday.
I need a proper lightbox. Now there are plenty of lightboxes out there that should satisfy my needs, but I could not find the perfect fit. My ‘demands’ are as follows:
- Flawless (X)HTML, also the generated code
- Can be used to display images, partial HTML, hidden content from same page, iframes (for form processing) and request contents with AJAX.
- auto adjust size to contents, unless overruled by settings.
- Easily styled through external CSS (I do not want to apply styles using JS)
- Can group images into sets and navigate through them
- Stacking of boxes (open lightbox from within a lightbox)
- jQuery may be used, but no other library (as it is already available in this specific project)
Who is your target group? Where do they live? The choice of the right domain extension (TLD) is crucial. We found a case where the effects of this choice are transparent.
Druppels (meaning “drops” in Dutch)
For The Netherlands and Belgium the common language is Dutch. So Belgian websites show up among the search results on google.nl and vise versa. Both druppels.nl and druppels.be have no real information regarding “drops”, they are both chosen as a name for the website (call it a brand). Searching for “druppels” on Google.be gives us (as expected) druppels.be as first result. Since druppels.be has a PageRank of 6 and druppels.nl has a PageRank of 3, it would be expected that druppels.be also shows up first on Google.nl, since the language is the same and the PageRank of druppels.be far exceeds that of druppels.nl. The result are the opposite, druppels.nl comes up first, the only difference being the domain extension, despite the lower PageRank. This means that my location (determined by .nl in google.nl) influences which sites show up, even though Google isn’t aware of the exact location behind druppels.nl (but expects it to be The Netherlands due to the extension).
Make your choice
So where do you want your business to be? Do you focus on regional visitors, don’t use a .com or .eu domain, if you don’t focus at all .com will do fine. Don’t like the dollar exchange rates? .eu is your choice.
This doesn’t mean you don’t have to register alternatives, but make sure the primary domain is targeted at your audience. This is an example however, where pretending to be large and international (by using a .com domain name) might just go at the cost of search engine traffic. Make sure your domain name and extension match your content!
Google posted an article on multilingual websites in which they say:
Let’s say your German content is specifically for users from Germany and not as relevant for German-speaking users in Austria or Switzerland. In this case, you’d want to register a domain on the .de TLD. German users will identify your site as a local one they are more likely to trust.
Trust is important to Google, they will most likely send their visitors to a website they asume the visitor will trust most.