Category Archive: PHP

Samples and findings of php that I use in certain websites.

Apr 14

PHP Rewrite URLs using Output Buffer

I recently was in need of replacing URLs to SEO friendly ones, the only hiccup was I wanted to maintain the PHP $_GET params in the source code. As this is tried and true, and mod_rewrite can have its hiccups now and then. So after some research I found a solution that fit me perfectly. …

Continue reading »

Nov 17

Move Row Up/Down with MySQL/PHP

Want to move rows with a click of a link and not have to worry about text boxes with position ID’s in them? Use this script/query to achieve this. Basically the idea is to have in your items table where it contains all the records you potentially want to move. In that table add a …

Continue reading »

Oct 28

Category Hierarchy into Select Box

For those interested in implementing a list of category items into a select box, here is a simple method for doing so. This will require only 1 query (assuming you store the category id and the parent id in the table). Organize your categories into a set of arrays function OrganizeCategories() { $refs = array(); …

Continue reading »