Category Archives: PHP

CodeIgniter installation and setup

Check PHP is a new enough version: php –version Copy the unzipped download to the folder above the web root. This is to improve security so a user can’t get to the files by typing a URL. Move the index.php file … Continue reading

Posted in PHP, Web development | Leave a comment

Get temp folder and unique file

This seems the best way to get both the system’s standard temp directory and create a unique file within it. if($options[“rename”]!=0) { if (!function_exists(‘sys_get_temp_dir’)) { function sys_get_temp_dir() // For PHP 4- { if($temp=getenv(‘TMP’)) {return $temp;} if($temp=getenv(‘TEMP’)) {return $temp;} if($temp=getenv(‘TMPDIR’)) {return … Continue reading

Posted in PHP, Web development | Leave a comment

Installing and setting up phpMyAdmin

This is unusually straightforward for open source software. From Unix command line: wget phpMyAdmin-3.3.9-english.tar.gz (or use curl instead of wget) tar -xvzf phpMyAdmin-3.3.9-english.tar.gz (on the webserver) ln -s phpMyAdmin-3.3.9-english phpMyAdmin (so you can access the better-named ‘phpMyAdmin’ and have it point … Continue reading

Posted in mySQL, PHP, Unix | Leave a comment

(Most) reliably working with UTF-8 in PHP

If these functions are used in place of the standard PHP string functions, results will be UTF-8 if at all possible. Other encodings can be given instead if desired. The code also includes some other useful string functions.

Posted in PHP, Web development | Tagged , | Leave a comment