Showing posts with label php. Show all posts
Showing posts with label php. Show all posts

Saturday, June 06, 2015

Beginner’s Guide to PHP for WordPress – Part 1 of 3

Beginner’s Guide to PHP for WordPress

WordPress allows us to do so much in terms of building websites without knowing any code. With themes and plugins and a powerful admin area there is a lot we can do without typing any HTML, CSS, JS or PHP. However, at a certain point you need to get into the code to really customize things and get a site to look or behave exactly how you want.

Sunday, March 02, 2014

Symfony 2: The Basics

Symfony 2: The Basics

In this first introduction video (of a new series), I'll show you the basics of working with the Symfony 2, PHP framework.

Monday, January 27, 2014

Validation and Exception Handling: From the UI to the Backend

Sooner or later in your programming career you will be faced with the dilemma of validation and exception handling. This was the case with me and my team also. A couple or so years ago we reached a point when we had to take architectural actions to accommodate all the exceptional cases our quite large software project needed to handle. Below is a list of practices we came to value and apply when it comes to validation and exception handling.

Monday, May 13, 2013

Make Client Side Data Available Server Side

Make Client Side Data Available Server Side

That would be pretty useful, right? Right now it's very common to User Agent "sniff" when you want to make a server-side decision about what to give the client. But UA sniffing has always sucked and sucks more every day. What you really want to know is stuff like "how big is the screen I'm serving to?" or "does the device I'm serving to have touch events?" - that way you can serve resources that are appropriate to those questions. Is there a way to get accurate client side information on the server side?

Monday, May 13, 2013

43 Ways to Optimize your PHP Code

Optimize your PHP Code
  1. If a method can be static, declare it static. Speed improvement is by a factor of 4.
  2. echo is faster than print.
  3. Use echo's multiple parameters instead of string concatenation.
  4. Set the maxvalue for your for-loops before and not in the loop.
  5. Unset your variables to free memory, especially large arrays.
  6. Avoid magic like __get, __set, __autoload
  7. require_once() is expensive

Thursday, April 18, 2013

Introducing The Magento Layout

Magento Layout
In this tutorial, we introduce the Magento layout by creating a simple module that will add some custom HTML content to the bottom of every customer-facing page, in a non-intrusive manner. In other words, we will do so without actually modifying any Magento templates or core files. This kind of functionality is a common requirement for many things such as affiliate referral programs, customer tracking analytics, adding custom JavaScript functionality, etc.

Thursday, April 18, 2013

The Basics Of Creating A Magento Module

Creating A Magento Module

A lot of community extensions (or modules) are available for the feature-rich open-source e-commerce solution Magento, but what if they don't quite work as you want them to? What if you could understand the structure of a Magento module a little better, to the point that you could modify it to suit your needs or, better yet, write your own module from scratch?

Wednesday, April 17, 2013

Build PDF files dynamically with PHP

Build PDF files dynamically with PHP

Sometimes you need control over exactly how pages are rendered for printing. At times like those, HTML is not the best choice. PDF files give you complete control over how pages are rendered and how text, graphics and images are rendered on the page. Sadly, APIs for building PDF files are not standard parts of the PHP toolkit. Now is the time to bring in a little help.

Wednesday, April 17, 2013

PHP & MySQL – Preventing MySQL Injection

Preventing MySQL Injection
In this tutorial I am going to explain what MySQL injection is and how important it is to prevent this attack on your database(s). It is vital that all security measures are in place before you make your website live because the effects can be devastating especially if you store sensitive data. Lets start with the basics and learn what MySQL injection is.

Tuesday, April 09, 2013

Namespaces With PHP

Namespaces With PHP
PHP namespaces was introduced in version 5.3. Namespaces is a way of group classes together into virtual directories, the main reason we would want to do this is to help avoid collision of class names in your application.

Wednesday, April 03, 2013

Formatted Strings With PHP

Formatted Strings With PHP
When you are using PHP to output a string on the page most of the time you will use the syntax echo, which will take the following string and display that string in HTML.

Monday, February 25, 2013

Test Driven Development With PHP

Test Driven Development With PHP Posted in Paulund

In a previous post I wrote about the benefits of using Test Driven Development in your application development process. This can be used in all types of development from software to web to front-end to back-end languages. In this post I will go through the steps of using Test Driven Development in PHP.

Friday, January 25, 2013

Creating web services using PHP

Creating web services using PHP

What is web service?

First of all I want to explain or define what is web service. You can think of web services as DLL files over the web. You write the code, then compile it and every one can use it whatever language they are using. But in the web you don't compile anything. Actually when I started using webservices, I was writing c# code so .NET was doing every thing for me. I couldn't understand what is happening behind the scene. I just type [webservice] above the function and everything is running, so in this article I'm going to explain what is happening.

Tuesday, October 16, 2012

Chained AJAX selects

Chained AJAX selects

In today's tutorial, we will build a set of chained select elements. Selecting an option in one of them will trigger an update on the page, showing you more choices to refine your selection. We will describe the options server side with PHP, so it is easy for you to hook today's example to a database.

Tuesday, October 16, 2012

Create a photo admin site using PHP and jQuery

Create a photo admin site using PHP and jQuery

I'm pleased to present you with part one of a two part series on creating a photo site using PHP, jQuery and AJAX. Originally, I intended to fit the entire tutorial into one screencast, but that quickly became a pipe dream as I realized that there was simply too much to cover. Nevertheless, even if you only watch this first video, you should learn a great deal.

Wednesday, October 03, 2012

HTML5 web storage – Cookies are so 1994!

HTML5 web storage

In this two part series, we're going to look at Web Storage, one of the best and most interesting features to come out of the HTML5 spec. We'll look at the history of both Web Storage and cookies, and consider the following points: