Posts Tagged ‘html’

Marking Up and Styling an Image Gallery

Tuesday, March 25th, 2008

While working on a new site (Rolling Horde), I decided to include a small image gallery. I randomly display four images from a flickr album in the sidebar.

The pictures are presented in the mark-up that flickr creates, and I used the styling that came with the template I was working from. It creates a simple two by two square of photos, with a slight gap in between them.

Although I like the way they are presented, I’m not sure I like the mark-up that flickr creates. What would be the simplest, semantic way to mark-up and style images in a small album like this?
(more…)

Five Useful, Simple Wordpress Plugins

Thursday, March 20th, 2008

I’ve been playing around with developing Wordpress sites for a while now. I love how quick and easy it is to launch a site and update content.

One of the greatest features is the thousands of plug-ins available for Wordpress. You can find a plug-in for just about anything you want to do – or if you have some PHP know-how, you can develop your own.

Here are five basic Wordpress plug-ins that I’d recommend using for any project you start.
(more…)

Flash Movies: Standards Compliant Embedding

Tuesday, March 18th, 2008

The other day, I was looking into using Picasa to create an image album and embed it as a slideshow on a website.

Uploading the images and creating the album was easy. However, I noticed that the code Google creates to embed the slideshow (a flash file) is not standards compliant – it uses the <embed> tag.

How can we convert this code to a standards compliant version?
(more…)

Anatomy of a Wordpress Template: The Basics

Monday, March 10th, 2008

There are tons of free Wordpress templates available, but at some point you’ll probably want to modify one or make your own. Even if you know HTML pretty well, this can be a daunting task at first.

Wordpress templates have a decent amount of simple PHP mixed in, and you need to utilize a special file structure for the template to operate correctly. Before you dive into making a Wordpress template, let’s look at the basic structure of a Wordpress template compared to a normal website template.
(more…)

How to Spoof a Form, or Why Your Form Isn’t Safe

Monday, February 25th, 2008

Forms can create all kinds of security holes in PHP applications. The biggest reason for this is that you can never be sure just what kind of input you’ll be getting.

There are some steps you can take later on to protect your applications from this unknown input. But first, let’s take a look at why you can never trust a user’s input and just how easy it is for someone to spoof a form.
(more…)

JS Game: Making a Real Game Board from a Concept

Wednesday, February 20th, 2008

In a recent post, I sketched out how to use Javascript to build a gameboard for a browser-based game – specifically Tic Tac Toe. After a little tweaking, I’ve worked this into a functioning Tic Tac Toe board.

In this post, we’ll explore the code used to set up this board. Once that’s done, the next step will be to create a php script to evaluate some of the game’s logic.
(more…)

How to Alternate CSS Styles Using PHP

Wednesday, February 13th, 2008

There are a lot of situations in which you’d like to alternate CSS styles from one element to the next. Long tables, for example, look a lot nicer when the background color of the rows is alternated.

How do we do that? Some pretty simple PHP can help you accomplish this task and spice up your HTML/CSS.
(more…)

Use Attribute Selectors to Fine Tune Your CSS

Thursday, January 31st, 2008

Here’s a quick tip for fine tuning your CSS declarations.

You can use attribute selectors to style an html element that contains an attribute with the value that you declare. This allows you to do a bunch of cool stuff – like style different “input” types differently, style anchor tags with titles differently, and etc.
(more…)

How to Use PHP To Dynamically Resize an Image

Wednesday, January 30th, 2008

Screenshot of a Dzone PageOne of the most annoying things about working with images is getting them into the right size. Screenshots start out huge – and you need to resize them to an appropriate size for your website.

Some blogs automatically resize the pictures for you into a thumbnail – like the image to the right. What if you want the image a different size, though? You could allow the browser to resize it for you, or – better yet – write your own php script to resize the image dynamically.
(more…)

How to Pass All Elements of a Form to the End in a Multi-Page Form

Sunday, January 27th, 2008

Sometimes forms get long, unsightly, and intimidating. It’d be great if you could cut them up into three or four parts – with a few fields on each page.

In order to do that, you need to figure out some way of storing or passing along the information from the first pages. I’ve heard a bunch of crazy ideas – from storing the information in session variables to writing each part to the database.

The easiest thing to do is attach a very brief php function to the bottom of each page. It’ll do all the work for you and continue to post every item the user has entered. (more…)