Join 402 people who get free RSS updates and follow us on Twitter.

Posts Tagged ‘php’

3 Easy Steps to Create Excel Spreadsheets in PHP

Spreadsheets are simple files that help you manage and organize data. They are used everywhere and have become quite popular. You can find them by using Microsoft Excel, Open Office, or even an online alternative such as Google Docs.

Spreadsheet

Generating Spreadsheets

Since computers and automation have become second nature, spreadsheet generation isn’t out of the ordinary. With MySQL databases, it becomes even more imperative, as spreadsheets are perfect to represent the data located in these structures.

Upon searching for how to create excel spreadsheets using PHP, most of the results came back with libraries that do the job. This seemed to be too much of a hassle. That’s why I’ve created 3 easy steps to create excel spreadsheets without any libraries.

Download the Files

Continue Reading…

Force Download Dialog Boxes

When we browse the web, we click on links. That’s what makes the web a web – the links between pages. Sometimes, those links lead us not to pages, but to files. Many types of files pop up dialog boxes prompting downloads – executables, videos, etc.

However, certain filetypes, thanks to modern web browsers, are rendered as an in-browser page, such as images, PDFs, and MP3s. While this may be a convenience, at times we may wish to force the user to download the files, not just view them in their browser.

In this article I will show two easy ways to do this. The first is using .htaccess, and the second is using PHP.

Continue Reading…

Intelligent Caching of the CSS Minifier

A few months back, I presented a stunningly simple CSS minifier that enables you to pack your CSS while still maintaining format and readability. Soon after that, I presented a system called Lateral Cache that you could use to store the minified CSS and deliver it quickly.

CSS

Although the Lateral Cache system works well and is great for general purposes, the CSS minifier can be aided by a more intelligent caching system. Well, what do I mean by that? That’s what you are going to find out.

View a Demo Download the Files

Please note that the demo link above directs you to Lateral Code’s own CSS file, where intelligent caching is used.

Continue Reading…

The Power of Options: Simple, yet Effective

Options are extremely powerful when it comes to building a website. They provide strong flexibility and facilitate many changes. Furthermore, they are largely present in many CMS systems and blogging platforms, such as WordPress.

Options

WordPress Options

For those of you who aren’t familiar with WordPress’ options system, it acts in a simple way:

// an option is stored with the specified $name and $value
add_option( $name, $value );

// an option is retrieved using the $name
get_option( $name );

// updates an option with $name, or creates a new one if it doesn't exist
// this is generally used more than add_option due to its flexibility
update_option( $name, $value );

The ability of these functions stems from their storage of data. Even through multiple requests, the data that is passed as options will stay in-tact. This is because options are stored in a database.

Continue Reading…

Removing .svn Directories With PHP

A few days ago, Lateral Code decided to switch over to using SVN (Subversion) for WordPress. This not only is an easy way to install WordPress for new users, but it also makes it a breeze to update your version.

For those of you who aren’t familiar with Subversion, it’s a version control system. You can read more about it here.

Subversion

The Invasion of .svn

Upon reinstalling WordPress with a few simple SVN commands, we noticed many .svn directories. These were located in every single section of our site’s files. Not only that, but we had also read about the dangers of keeping .svn directories in our file system earlier through Smashing Magazine.

Continue Reading…