Home » MODx »PHP

PHP (Hypertext Processor) is a widely used and free scripting language primarily used for website development. PHP is an interpreted language popular for it’s loosely typed nature, support of multiple database systems, general purpose focus, different coding styles and large number of free and open source libraries to name a few.

Refresh / Clear MODx (Revolution) Cache from PHP Script

4th
Mar
modx icon

Refresh / Clear the MODx Revolution cache outside of MODx with PHP.

PHP: Using constants in Heredoc

20th
Jan
php icon

Using constants inside heredoc blocks does not work…

Auto Resize Images with MODx (Plugin)

29th
Apr
modx icon

A MODx plugin to automatically resize images placed inside documents (pages). It searches content for image elements that have the width or height specified, compares it to the current image size and then scales accordingly.

It saves images to the MODx Cache and improves the quality of images and the speed of the page(s).

MODx – Wayfinder Incorrect Order (menu index)

9th
Mar
modx icon

If you’re using an older version of MySQL then the MODx Wayfinder snippet might fail to order your navigation correctly (regardless of your menu indexes). Here’s one solution.

Magento Admin (Dashboard) Login Not Working Locally

3rd
Mar
magento icon

If you can’t log into Magento, when developing or testing locally, you will need to perform a few minor changes to have access to the Magento admin backend.

MODx – Include Page Content Snippet

5th
Nov
modx icon

A quick and easy snippet to include a MODx page’s content in another page.

Recursive Directory Scan/Mapping PHP Function

15th
Oct
php icon

Here’s a quick and simple function I thought I’d share. It recursively scans and maps from a set directory to an array in PHP.

Determing Login State (MODx)

15th
Sep
modx icon

I came to a bit of a road block when trying to determine whether a user is logged in or not with WebLoginPE on MODx. This is a quick and dirty snippet for determining a users login state.

Changing MODx Managers Document Tree View Nodes

14th
Aug
modx icon

A small niggle I found with MODx was the document tree view that’s displayed in the left hand side of the manager. It displays the “resources” title (aka the page title) which is bit confusing like shown below. After a quick browse through the source I changed it to display the resources alias.

PHP URL Rewriting Without Apache and mod_rewrite

15th
Jul
php icon

Recently I was put in a situation where I had created a dynamic site that, prior to launch, needed Search Engine Friendly (SEF) URL’s. Without any admin access to the IIS server I was working on, no IIS modules/filters and extremely limited access in the control panel I came up with a method of URL rewriting purely in PHP without Apache and mod_rewrite.

MD5 and SHA1 “Decrypting” with PHP / MySQL

30th
Jun
mysql icon

In this reference we’re going to look at how to “decrypt” (or more accurately “collide”) MD5 and SHA1 hashes by creating a resource of pre-hashed words.

SQL Injections: Introduction with PHP/MySQL

29th
Jun
php icon

Providing you know SQL you can perform SQL injections on websites that perform unescaped queries. In this reference we’ll use a hands on approach and start by performing our own basic injections based on website user input and then looking into prevention methods.

PHP DOM Document Class

17th
May
php icon

The PHP DOMDocument class in PHP allows you to manipulate HTML and XML files by getting elements, creating elements, validating pages, saving pages and more.

In this quick example we’ll use the DOM Document class to extract links from a remote page, something I’ve had to do recently.

Flex 3 with PHP

30th
Jul
php icon

I’ve recently started to develop with the Linux alpha version of Flex Builder and was looking around for a decent introduction for using Flex 3 with PHP. Unfortunately there was nothing basic and the majority of articles related to Flex 2 and simply didn’t work. So here is an article ground down to the bare basics.