Conversion of difboxning.se from asp.net to php