Luxembourg: Referral recruitment on the web

Do your friends like to complain about their jobs? Do you sometimes think they should pay you just for listening to them? Well, x-change.lu can’t do that, but if you use this new recruiting website to find a job for someone else you can earn between 250 and 5000 €! (Yes, we’re talking about regular jobs in Luxembourg here and not about signing up with some mercenary organization)

Here’s a demo showing how it’s supposed to work (in French only, like the entire website).

Hat tip to business review (print edition May 2008).

Sharing session data across domains with PHP

This ancient post from 2008 is still quite popular and really shouldn’t be, as this approach has security issues:

  1. The session ID is exposed in the POST request.
  2. The receiving page accepts the session ID without additional validation that it belongs to a legitimate session initiated by the same user.

Original post below.


The problem: Multiple domains hosted on one server needed access to the user’s session data. In my case, various shopping domains were sharing one (SSL-enabled) domain where the users could place their orders.

The solution I found was surprisingly simple: Since these domains were hosted on the same server and used the same session save path, I was wondering if I could simply pass the existing session ID along to the new domain in order to give it access to the corresponding session file. Indeed all it took was a hidden form field containing the session ID and something like “session_id($_POST[‘SID’])” on top of the first page of the ssl-domain (before session_start()). Voilà, the old session ID was also the new one and the ssl-domain could continue working with the session data. Continue reading Sharing session data across domains with PHP

LEO spricht jetzt auch Chinesisch

Auf der ursprünglich für ihr Deutsch-Englisches Wörterbuch bekannten Seite LEO ist seit kurzem auch ein Deutsch-Chinesisches Wörterbuch verfügbar. Unterstützt werden sowohl traditionelle als auch vereinfachte Schriftzeichen sowie Pīnyīn. Die Pīnyīn-Eingabe kann praktischerweise auch mit Ziffern für die Töne erfolgen, so z.B. yan2lun4 zi4you2 statt yánlùn zìyóu (weitere Suchtipps hier).

Delete line numbers from program code listings

Many of the books available on O’Reilly’s Safari Books Online come in HTML format, which I like because it makes it easy to copy code straight out of the book (no need to search for the “companion files”). However, program listings in books often use line numbers, which prevent the code from running if it’s just copied and pasted. That’s why I wrote this little tool to automatically remove the line numbers. It uses the first line to determine where the code starts and then applies the same format to the rest of the listing.

Please note: Internet Explorer likes to mangle up the results (it ignores the “text/plain” content-type HTTP header if it sees any tags), if this happens you’ll have to view the source to get your program listing.