Monday, March 8, 2010

POST array in PHP decoded wrong??

I just stubled upon an error? in the way PHP decode the keys in the $_POST array. If you define an input field in a form with a name containing a . (period) f.x. 'test.field', then the corresponding key in the $_POST array, when posted to a PHP script, will be 'test_field'. PHP substitute the . with a _ (underscore). According the HTML spec the . is a legal character in the name as long as it starts with [a-zA-Z].
So why do PHP make this substitution? I tried to find the answer online, but without any luck. Please post a comment if you know the answer or where to find it.

Update
I found this comment on php.net http://www.php.net/manual/en/language.variables.external.php#81080 Apparently this is done for backwards compatibility with register globals.

Thursday, December 10, 2009

Happy camper qwerty-keyboard in danish

Finally I got a danish keyboard on my HTC Magic.

I bought my Magic a few month ago and I must say "I love it" (quote Ole H.) But since day 1 a danish qwerty-keyboard has been missing. About a month ago a lost my patients with HTC and unlocked my phone and installed a modded version of Android 1.6. I too want the new features. Btw. the Tattoo and Hero are ugly, so no I will not buy one of them. Well back to the original subject. My new and improved Magic with A 1.6 was rolling, YIR! But still no danish qwerty-keyboard and now I don't even have my danish dictionary any more, crap. But to day i found to obvious solution, Android Marked. A kind soul told me that I could just search the Android Marked for a danish qwerty-board and a danish dictionary. Search search search.... PLING... Keyboard and dictionary found and dl in 30 sec. Quick setup of the keyboard and now I'm rolling wind texting i danish.

Thank you Android Marked

So a word of advise for the next time for you and me, go to the marked

Friday, November 27, 2009

php, LDAP and the whole tree

After using several hours on trying to search the entire AD tree on Windows 2003, I finally found the solution. Copied directly from php.net:

allie at lsu dot edu
06-Mar-2007 10:23
I sure do wish there was some way I could get this information out to all programmers in the world about binding and searching MS AD. This is the second time I was bit by the "I need to search the entire tree" problem.

For php (and apache auth_ldap ) you need to specify port 3268 when you want to search the entire tree. Otherwise it will spit out the partial results error.

ldap_connect($server,3268);

I'm just fortunate enough to have won this same battle with apache searching the whole directory. When I noticed our php application failing auth's for users, I was immediately able to fix the problem by adding this port specification (and the ldap_set_option($ldapserver, LDAP_OPT_REFERRALS, 0) option).

I really hope this helps someone else before they pull all their hair out. I know I miss mine.

Tuesday, May 26, 2009

Glemte HTML tags

Faldt over denne artikel, som beskriver 10 tags, som man burde bruge i stedet for at misbruge DIV tags.

Friday, February 20, 2009

JSLint

Bruger du JavaScript, så er JSLint programemt for dig. JSLint bruges til at validere korrektheden af din JS kode. JSLint tjekker for om du skriver din JS kode rigtigt. JSLint bruger validere koden ud fra Douglas Crockfords ide om hvad god JS kode er. Douglas Crockford er JS guru hos Yahoo. Du kan finde JSLint her.