Advertisement

Posts Tagged ‘php’

11|17

Simple Templates: Easy as Pie

The Problem

I’m working on a project and have to generate the same template on 4 different pages. I was also using javascript to create the same template on the fly. Needless to say this wasn’t the most efficient way of doing things because if I needed to change 1 aspect of the template, I needed to edit 4 different files.

I tried to write a little function, inspired by CakePHP, that would take an array of information, open up a template, replace any text and then return the new content. Continue reading

11|05

PHP Shorthands: Write Less Code!

Writing a lot of code can get very tedious especially when you are in hour 6 of your work day. I’m always looking for way to write less code so i’m going to share a few tips that I use on a daily basis. Continue reading

10|22

How To Tame Your PHP Error Logs

I recently watched a quick Screenr screencast by Jeffrey Way about logging your errors in PHP to a text file. Needless to say, I was a little bit inspired.

It was only a quick 5 minute tutorial so it didn’t go into much detail and after implementing it into one of my projects it needed some tweaking.

The main problem was there was the potential for your site to create thousands of indistinguishable error logs. My solution was to create folders to house daily log files. This makes your error logs live inside a nice folder structure broken down by year, month and day. Continue reading

10|05

Learning PHP on Mac OS

So you’ve decided that you want to learn a new language and PHP is your language of choice. Now that you’ve made your decision, I’m going to walk you through how to get PHP running on your system and how to begin learning a new language.

Continue reading

10|05

How to Include All Your Functions In 3 Lines of Code

Functions are amazing. Working with huge function files is not.

I like to group all my functions into different “function files” to keep everything nice and clean. For example, I’ll keep all my functions that clean up various strings or elements in a clean.php file.

This is great because I don’t have to scan a 50000 line PHP file to find the function that I’m looking for.

As your application grows, the number of function files may grow with it. This can pose a problem. Did you remember to include the new function file in all necessary scripts?

Continue reading

09|30

Partially Functional

PHP functions can be extremely useful if you have a chunk of code that you plan on using multiple times in your scripts. Functions keep everything all neat and tidy and in the case you have to make a change, you only have to edit one place instead of multiple places.

Continue reading

09|28

Combine Your CSS Files with PHP

I like to work with multiple CSS files. I also like to limit the number of HTTP request my site/app is making.

I’ve seen a couple methods on the Internet of using PHP to combine your files and decided to use some of those methods in my own little script.

Basically this script lives in your CSS folder. It grabs every file, opens it up, takes the content and then mashes it all together. It also takes our new content and strips any comment and white space to create a new compressed file.

Continue reading

09|24

Oxygenfit

Oxygenfit is a dynamic brand of home and travel fitness equipment designed for women. Whether you’re traveling or working out at home, our dedication to your fitness experience will speak to you through our products and the interactive aspects of our website.

I was responsible for developing a full featured e-commerce cart system. I used PHP and MySQL to drive the site as well as a 3rd party payment and shipping system.

Feel free to check out the site and see how it functions!

All content property of Vantage Studios Inc.

09|23

How to Code a Signup Form with Email Confirmation

No one likes spam and what’s worse is fake users falsifying your stats.

In this tutorial we are going to use PHP and MySQL as well as the Swift Mailer class to deal with user signups and email confirmation.

View the Tutorial

This tutorial is now owned by NetTuts+, I’m just the author.

09|22

Injection with Mootools – Part 3: Saving

We’ve got our list adding items and now everything can be sorted.

Lets wrap up the tutorial and add the ability to save the list!

Continue reading