PHP 4.3.9 $_SESSION values not being retained

Symptoms: After calling session_start() and assigning key-value pairs to $_SESSION, calling print_r($_SESSION) on subsequent pages result in an empty array; i.e. $_SESSION values are not retained across pages. Solution: Assuming your php.ini (session) save_handler, save_path variables are set correctly, also check if sufficient disk space is available. I spent 90 minutes trying to resolve the […]

Read More PHP 4.3.9 $_SESSION values not being retained

Programmer questions

What is the output for the following 3 code snippets? $x = 3; if (4 < $x) { print "The quick brown fox jumps over the lazy dog."; } else { print "She sells seashells on the seashore."; } $x = 1; $x = ++$x * 2; print $x; $x = 1; $x = $x++ […]

Read More Programmer questions

CodeIgniter: Charset issues

I was having some internationalization (i18n) issues with one of my sites recently. At this (relatively) advanced level of development on the web, I was still using the ANSI charset to encode my views. This was a big problem, as the end-user often used characters that fell outside of ANSI. These characters were somehow being […]

Read More CodeIgniter: Charset issues

PHP4 issue (v4.4.5)

I just spent the last 3 hours trying to figure out how come, after upgrading the PHP version on my web server, two websites were broken. In particular, these two were done using my colleague’s new framework — which is pretty good — but they just wouldn’t work. Apache2 would prompt to download the .php […]

Read More PHP4 issue (v4.4.5)