Posts Tagged ‘PHP’

We are pleased to present below all posts tagged with ‘PHP’.

Creating A Client-Side Shopping Cart

Session storage is a new feature introduced by the W3C’s “Web Storage” specification. It’s supported in Internet Explorer 8+, Firefox, Chrome, Safari and Opera Desktop (for a complete list, please consult “Can I Use”).

var total = parseInt( sessionStorage.getItem( "total" ) );
var quantity = 2;
var updatedTotal = total * quantity;
sessionStorage.setItem( "total", updatedTotal ); // '240', a string

In this series of articles, we’ll cover in depth a practical implementation of session storage by creating a complete e-commerce shopping cart with the sessionStorage object and jQuery.

Read more...

Part TwoHow To Fix The Web: Obscure Back-End Techniques And Terminal Secrets

Editor's Note: Today we are happy to present to you the second part of the sample chapter from the upcoming printed Smashing Book #4: New Perspectives on Coding, written by Paul Tero. You might want to read the first part of this chapter beforehand — if you haven't already. Also, feel free to download the full chapter from the Smashing eBook Library.

Imagine that you wake up one morning, reach groggily for your laptop and fire it up. You’ve just finished developing a brand new website and last night you were proudly clicking through the product list. The browser window is still open, the Widget 3000 is still sparkling in its AJAXy newness.

How To Fix The Web: Obscure Back-End Techniques And Terminal Secrets

You grin like a new parent and expectantly click on “More details”. And nothing happens. You click again, still nothing. You press Refresh and get that annoying swirling icon and then the page goes blank. Help! The Internet is gone!

Read more...

Introducing The 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.

Introducing The Magento Layout

This kind of functionality is a common requirement for many things such as affiliate referral programs, customer tracking analytics, adding custom JavaScript functionality, etc. We will be covering a number of interesting topics, including Magento layout handles, layout XML files, blocks and templates, and an alternative to widgets.

Read more...

Replicating MySQL AES Encryption Methods With PHP

At our company, we process a lot of requests on the leading gift cards and coupons websites in the world. The senior developers had a meeting in late October to discuss working on a solution to replicate the MySQL functions of AES_ENCRYPT and AES_DECRYPT in the language of PHP.

Replicating MySQL AES Methods With PHP

This article centers on what was produced from Senior Developer Derek Woods and how to use it within your own applications. Security should be on the top of every developers mind when building an application that could hold sensitive data. We wanted to replicate MySQL's functions because we have a lot of our data already AES encrypted in our database, and if you are like us you probably do as well.

Read more...

WordPress Shortcodes: A Complete Guide

WordPress shortcodes were introduced in version 2.5 and since then have proved to be one of the most useful features. The average user acting as editor has the ability to publish dynamic content using macros, without the need for programming skills.

When a shortcode is inserted in a WordPress post or page, it is replaced with some other content. In other words, we instruct WordPress to find the macro that is in square brackets ([]) and replace it with the appropriate dynamic content, which is produced by a PHP function.

Read more...

A Guide To PHP Error Messages For Designers

PHP is widely available with inexpensive hosting plans, which makes it a popular choice for developers who write software for the Web. From big platforms, such as WordPress, down to small scripts, such as ones to display image galleries or to send forms to email, thousands of script and products are out there written in PHP that can be installed and used even if you don’t know much about PHP yourself.

A Guide To PHP Error Messages For Designers

I have been a PHP developer for 10 years, and my company has developed a content management system, written in PHP, that is intended to be very simple to install and get started with. So, I spend a lot of time working with designers who are installing a PHP script for the first time. If you are installing a script and something goes wrong, PHP can be incredibly infuriating.

Read more...

WordPress Multisite: Practical Functions And Methods

Multisite is a powerful new feature that arrived with the release of WordPress 3.0. It allows website managers to host multiple independent websites with a single installation of WordPress. Although each “website” in a network is independent, there are many ways to share settings, code and content throughout the entire network.

WordPress Multisite: Practical Functions And Methods

Since the beginning of the year, I’ve been developing themes and plugins for a WordPress Multisite-powered content network. During that time I’ve learned many powerful tips and tricks unique to Multisite. This guide will introduce you to a few Multisite-specific functions, along with real-world programming examples that you can begin using today. Hopefully, it will open your eyes to a few of the new possibilities available in Multisite.

Read more...

Introduction To URL Rewriting

Many Web companies spend hours and hours agonizing over the best domain names for their clients. They try to find a domain name that is relevant and appropriate, sounds professional yet is distinctive, is easy to spell and remember and read over the phone, looks good on business cards and is available as a dot-com.

Screenshot

Or else they spend thousands of dollars to purchase the one they really want, which just happened to be registered by a forward-thinking and hard-to-find squatter in 1998. They go through all that trouble with the domain name but neglect the rest of the URL, the element after the domain name. It, too, should be relevant, appropriate, professional, memorable, easy to spell and readable. And for the same reasons: to attract customers and improve in search ranking.

Read more...

How To Use AJAX In WordPress

In the last few years AJAX has creeped into websites and has slowly become THE way to create dynamic, user friendly and responsive websites. AJAX is the technology that lets you update the contents of a page without actually having to reload it in a browser. For example, Google Docs utilizes this technology when saving your work every few minutes.

sm-ajax-2011

While there are a number of ways to use AJAX in Wordpress = and all are correct in the loose sense of the word - there is a method which you should be using since WordPress supports it, it is future proof, very logical, and gives you numerous options right out of the box.

Read more...

WordPress Essentials: Interacting With The WordPress Database

While many functions you already use in WordPress communicate with the database there is an easy and safe way to do this directly using the $wpdb class. Built on the great ezsql class by Justin Vincent, $wpdbwill allow you to address queries to any table in your database, and it will also help you handle the return data. Since this is built in WP functionality, there is no need to open a separate database connection (you would be duplicating code in this case), and there is no need to do hacks, like modifying a result set after it has been queried.

$wpdb class

In this article I will show you how to get started with the $wpdb class, how to retrieve data from your WordPress database and how to run more advanced queries which update or delete something in the db. The techniques here will remove some of the contraints that you run into with functions like get_posts() or wp_list_categories(), allowing you to tailor the queries you make to your specific needs. This method can also make your website more efficient by only getting the needed data, nothing more, nothing less.

Read more...

↑ Back to top