Posts Tagged ‘PHP’

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

My Favorite Programming Mistakes

Over my programming career, I have made a lot of mistakes in several different languages. In fact, if I write 10 or more lines of code and it works the first time, I’ll get a bit suspicious and test it more rigorously than usual. I would expect to find a syntax error or a bad array reference or a misspelled variable or something.

My Favourite Programming Mistakes

I like to classify these mistakes into three broad groups: cock-ups (or screw-ups in American English), errors and oversights. A cock-up is when you stare blankly at the screen and whisper “Oops”: things like deleting a database or website, or overwriting three-days worth of work, or accidentally emailing 20,000 people. Errors cover everything, from simple syntax errors like forgetting a } to fatal errors and computational errors.

Read more...

How To Build A Media Site On WordPress (Part 1)

WordPress is amazing. With its growing popularity and continual development, it is becoming the tool of choice for many designers and developers. WordPress projects, though, are pushing well beyond the confines of mere "posts" and "pages". How do you go about adding and organizing media and all its complexities? With the introduction of WordPress 3.1, several new features were added that make using WordPress to manage media even more practical and in this tutorial, we're going to dive in and show you how.

In part one, we're going to setup custom post types and custom taxonomies, without plugins. After that, we'll build a template to check for and display media attached to custom posts. Then, in part two, we'll use custom taxonomy templates to organize and relate media (and other types of content).

Read more...

New WordPress Power Tips For Template Developers And Consultants

It has been a big year for WordPress. If there were still some lingering doubts about its potency as a full-fledged content management system, then the full support for custom taxonomies and custom post types in WordPress 3.0 core should have put them to rest. WordPress 3.1 took those leaps one step further, polishing custom taxonomies with multi-taxonomy query support, polishing custom post types with native template support for archives and feeds, and introducing features (like the “admin bar”) that make it easier to quickly edit and add content from the front end.

Screenshot

[fblike]

In the broader community, we’ve seen incredible plug-in suites such as BuddyPress mature, and even the emergence of independent WordPress-dedicated hosting services, such as page.ly. To celebrate WordPress’s progress, let’s review some new tips that can help template developers and consultants up their game even further.

Read more...

Image Manipulation With jQuery & PHP GD

One of the numerous advantages brought about by the explosion of jQuery and other JavaScript libraries is the ease with which you can create interactive tools for your site. When combined with server-side technologies such as PHP, this puts a serious amount of power at your finger tips.

Image Manipulation With jQuery and PHP GD

[fblike]

In this article, I’ll be looking at how to combine JavaScript/jQuery with PHP and, particularly, PHP’s GD library to create an image manipulation tool to upload an image, then crop it and finally save the revised version to the server. Sure, there are plugins out there that you can use to do this; but this article aims to show you what's behind the process. You can download the source files for reference.

Read more...

Ten Things Every WordPress Plugin Developer Should Know

Plugins are a major part of why WordPress powers millions of blogs and websites around the world. The ability to extend WordPress to meet just about any need is a powerful motivator for choosing WordPress over other alternatives. Having written several plugins myself, I've come to learn many (but certainly not all) of the ins-and-outs of WordPress plugin development, and this article is a culmination of the things I think every WordPress plugin developer should know. Oh, and keep in mind everything you see here is compatible with WordPress 3.0+.

Screenshot

[fblike]

The first thing you should do when developing a WordPress plugin is to enable debugging, and I suggest leaving it on the entire time you're writing plugin code. When things go wrong, WordPress raises warnings and error messages, but if you can’t see them then they might as well have not been raised at all. Enabling debugging also turns on WordPress notices, which is important because that's how you'll know if you're using any deprecated functions.

Read more...

Keeping Web Users Safe By Sanitizing Input Data

In my last article, I spoke about several common mistakes that show up in web applications. Of these, the one that causes the most trouble is insufficient input validation/sanitization. In this article, I'm joined by my colleague Peter (evilops) Ellehauge in looking at input filtering in more depth while picking on a few real examples that we've seen around the web. As you'll see from the examples below, insufficient input validation can result in various kinds of code injection including XSS, and in some cases can be used to phish user credentials or spread malware.

Screenshot

[fblike]

To start with, we'll take an example[1] from one of the most discussed websites today. This example is from a site that hosts WikiLeaks material. Note that the back end code presented is not the actual code, but what we think it might be based on how the exploit works. The HTML was taken from their website. We think it's fair to assume that it's written in PHP as the form's action is index.php.

Read more...

What To Do When Your Website Goes Down

Have you ever heard a colleague answer the phone like this: "Good afterno… Yes… What? Completely?… When did it go down?… Really, that long?… We'll look into it right away… Yes, I understand… Of course… Okay, speak to you soon… Bye." The call may have been followed by some cheesy ’80s rock ballad coming from the speaker phone, interrupted by "Thank you for holding. You are now caller number 126 in the queue." That's your boss calling the hosting company's 24 hour "technical support" line.

Screenshot

[fblike]

An important website has gone down, and sooner or later, heads will turn to the Web development corner of the office, where you are sitting quietly, minding your own business, regretting that you ever mentioned "Linux" on your CV. You need to take action. Your company needs you. Your client needs you. Here's what to do.

Read more...

↑ Back to top