PHP Posts

jQuery / Javascript

Flexible ajax using jQuery

jordanrodriguez • December 22, 2012

We recently had to send a delete request to a javascript confirm. We were using bootstrap so instead of the standard confirm(); command we wanted to display our own module. We also wanted a universal command…

Read More

PHP

How Can I Make a Php Alphabet Loop?

Sarah Berg • December 21, 2012

A useful feature of many coding languages is the “for loop”. A basic loop in php has for following structure: for (init; condition; increment) { code to be executed; } Parameters: init: Mostly used to set…

Read More

PHP

How do I remove a domain from a string in PHP?

Sarah Berg • November 15, 2012

This doesn’t feel like it should be that hard, and luckily it’s not! However, some of the more common ways I found had been commented on being rather unreliable.  Most people recommend an easy str_replace, removing…

Read More

PHP

How PHP Globals Work

jsandahl • November 14, 2012

I had a reminder of how globals work recently. I was trying to perform a WordPress query using the $wpdb global for the database. The global was declared at the top of the file like this:…

Read More

PHP

Backing up files into a tar.gz and uploading them elsewhere with FTP all in PHP

Andy Stramer • November 8, 2012

File redundancy is always important. One only learns how important when they lose their site once. If your site is php, you can even create a script to back up your site for you: $files =…

Read More

PHP

How to Use Multiple Conditions in a Single If Statement

jsandahl • November 2, 2012

This is certainly elementary programming knowledge, but bears repeating here. The scenario is that you need to check multiple cases in order to execute a certain piece of code. The scenario might be if you have…

Read More

API

Getting the cheapest Buy It Nows with Ebay Finding Service API and PHP

Andy Stramer • October 13, 2012

Prerequistes: cURL and a Ebay Account. Everyone likes a good deal. With the Ebay API you can build your own tools that may give you a leg up on all the other deal seekers. Ebay’s API…

Read More

Kohana

Kohana CRUD – Or How to Create, Update, and Delete From the Database with ORM

jsandahl • October 4, 2012

ORM::factory has become a good friend as of the last few weeks. Once you understand the basic idea behind queries, you know they can be reduced down to CRUD. That is, you will be Creating, Updating,…

Read More

Kohana

Create Your Own Kohana Module

jsandahl • September 24, 2012

Kohana surprises once again with its simplicity in working with the code. Let’s say you have a framework or class and you want to make it load on every page within your Kohana application. Regularly, you’d…

Read More

Kohana

Getting Started with Kohana

jsandahl • September 19, 2012

So you’ve read my Model-View-Controller article from last week and now you’re ready to get started working with Kohana, the best open-source, lightweight MVC out there for PHP. I’ve simplified the process I use for your…

Read More

Kohana

How Does a Model-View-Controller Work?

jsandahl • September 13, 2012

There’s a lot of buzz around the term Model-View-Controller (MVC) and frameworks. If you’re just starting to wrap your mind around how they work, this article is written for you. If you’re considering using MVC, here’s…

Read More

MySQL

Looping through Mysql Columns

Andy Stramer • October 5, 2009

Recently I was looking into a way to echo out each column name of a mysql database. Of course I needed to do it dynamically as the database could change and the application is in PHP….

Read More

PHP

Growl from PHP

Tim Barsness • July 29, 2009

I just found this nifty PHP class for sending growl notifications from sitecrafting.com.  Very nifty.  Here’s some sample code to get it going: // Setup $growl = new Growl(); $growl->setAddress(’127.0.0.1’); $growl->addNotification("Test"); $growl->register();   // Send Notification…

Read More

PHP

Generate Random Strings in PHP

Tim Barsness • May 11, 2009

I needed to generate some random strings today for password resets.  Here’s what I used: function genRandomString($length = 10) { $characters = ‘0123456789abcdefghijklmnopqrstuvwxyz’; $string = ”;   for ($p = 0; $p < $length; $p++) {…

Read More