The End of an Era: Internet Explorer Drops Below 50 Percent of Web Usage

This is post is now quite old and the the information it contains may be out of date or innacurate. If you find any errors or have any suggestions to update the information please let us know or create a pull request on GitHub http://www.webmonkey.com/2011/11/the-end-of-an-era-internet-explorer-drops-below-50-percent-of-web-usage/ Anyone who had had to either do an extra 50% of work to get IE working, or had to pay someone else to do so. I’m sure you are thinking what we think. Read On →

PHP Swift Mailer Not Working with Google Apps

This is post is now quite old and the the information it contains may be out of date or innacurate. If you find any errors or have any suggestions to update the information please let us know or create a pull request on GitHub If you are struggling trying to get PHPMailer working with Google Apps then perhaps this is the solution for you. I went to the PHPMailer site and found my way to a SourceForge download. Read On →

Magento Create Admin User Script

Often we will be asked to work on a site and have to test backend features but without asking for admin passwords, so we need a way to create admin users without admin access. Of course we already have file and database access. For this, we use phpmyadmin or adminer to give us database access and run the following php script at the commandline :- <?php function Readln() { $handle = fopen('php://stdin','r'); return rtrim(fgets($handle),"\n"); } echo 'Enter username [or hit enter for "someadminuser"]: '; $username = Readln(); if ("" == $username) { $username = 'someadminuser'; } echo "\n"; echo 'Enter password [or hit enter for the usual one]: '; $password = Readln(); echo "\n"; echo 'Enter table prefix [or hit enter for none]: '; $prefix = Readln(); echo "\n"; $salt = 'EC'; echo "Salted is : "; if (!empty($password)) { echo $hash = md5($salt.$password).':'.$salt; } else { echo $hash = '20f808df3d6e913ec43164ad2e7be85e:EC'; } echo "\n\n"; echo "SQL for insert : \n"; echo <<< EOT insert into ${prefix}admin_user select (select max(user_id) + 1 from ${prefix}admin_user) user_id, 'Edmonds' first_name, 'Commerce' last_name, 'nojunkplease@mailinator.com' email, '$username' username, '$hash' password, now() created, NULL modified, NULL logdate, 0 lognum, 0 reload_acl_flag, 1 is_active, (select max(extra) from ${prefix}admin_user where extra is not null) extra; insert into ${prefix}admin_role select (select max(role_id) + 1 from ${prefix}admin_role) role_id, (select role_id from ${prefix}admin_role where role_name = 'Administrators') parent_id, 2 tree_level, 0 sort_order, 'U' role_type, (select user_id from ${prefix}admin_user where username = '$username') user_id, '$username' role_name \n \n EOT; ?> The output looks like this :- Enter username [or hit enter for “someadminuser”]: Enter password [or hit enter for the usual one]: Enter table prefix [or hit enter for none]: Salted is : 20f808df3d6e913ec43164ad2e7be85e:EC SQL for insert : insert into admin_user select (select max(user_id) + 1 from admin_user) user_id, ‘Edmonds’ first_name, ‘Commerce’ last_name, ‘nojunkplease@mailinator.com’ email, ‘someadminuser’ username, ‘20f808df3d6e913ec43164ad2e7be85e:EC’ password, now() created, NULL modified, NULL logdate, 0 lognum, 0 reload_acl_flag, 1 is_active, (select max(extra) from admin_user where extra is not null) extra; insert into admin_role select (select max(role_id) + 1 from admin_role) role_id, (select role_id from admin_role where role_name = ‘Administrators’) parent_id, 2 tree_level, 0 sort_order, ‘U’ role_type, (select user_id from admin_user where username = ‘someadminuser’) user_id, ‘someadminuser’ role_name Which we can then copy and paste into the database admin. Read On →

Mount --bind - like symlinks only better!

This is post is now quite old and the the information it contains may be out of date or innacurate. If you find any errors or have any suggestions to update the information please let us know or create a pull request on GitHub If you use Linux on a regular basis, you’ll probably know just how useful a symlink is. This makes things extremely annoying when a program refuses to work with them - treats them as a file or just refuses to work. Read On →

Starting an Ecommerce Business, in a Nutshell

This is post is now quite old and the the information it contains may be out of date or innacurate. If you find any errors or have any suggestions to update the information please let us know or create a pull request on GitHub It may be obvious but after a discussion in the office we decided to put together a simple guideline for getting into e-commerce. This is a list of things that you need to do in order to start selling from your own web site. Read On →

Quickly Get a List of Files in PHP with glob()

This is post is now quite old and the the information it contains may be out of date or innacurate. If you find any errors or have any suggestions to update the information please let us know or create a pull request on GitHub Perhaps not as well known as it should be, PHP’s glob() function is really quite powerful and exceptionally handy. Need to get a list of files in a directory - try this: $tools = glob('includes/tools/*'); var_dump($tools); Want to delete all files matching a specific pattern, try this: array_map('unlink', glob('export_feeds/my_feed_*')); Theres lots more tricks you can do. Read On →