Resizing images via the web with PHP

Oftentimes you might want to display an image on the web that is a certain size, whether to avoid breaking your beautiful (CSS of course) layout, preventing download times getting too long or so on. Intelligent people like you would of course not even consider using the HTML <img> tag's width and height properties to fake resizing, the consequence of which is usually that your reader waits for a megabyte of picture to download before seeing a messed-up 10x10 pixel thumbnail. Naughty.

Of course if you have the image in advance, and there's not too many of them, you can resize it on your computer before upload. On the other hand, if the image is getting added later and is somewhat unpredictable in nature - for instance to be uploaded by a visitor to your site - it would be nice to allow them to avoid having to do that themselves, or more likely, ruin your page because they couldn't be bothered to do so. Enter Mr PHP.

Using forms in PHP: using the form's information

Once you have created the form that the user fills in, you now need the page that does something with the information. The page itself will include PHP code in order to deal with the form information, but other than that can have any other content on it as well.

As we are assuming you know how to write basic HTML, the examples below will just illustrate how to use the entries your user put into the previous page's form in this your page. To recap, this secondary page that features the values your user input must be the page mentioned in the "action" attribute of the form they filled in, and the user must have filled in the form and clicked submit to arrive at this page. The key thing here is that you cannot simply test your page by loading it without filling in the form on the first page and pressing submit.

Using forms in PHP: setting up the form

A form is an area of a webpage that gives the user places to enter information, whether it is in the form of a box they can type text into, a dropdown list, a set of check boxes or something different. These individual parts of a form can be called controls, and in HTML terms they should all fall within the opening and closing and tag. A brief guide to writing HTML forms is available from

Using forms in PHP

So Webmasters and mistresses, you've already learned how to make nice pretty forms appear on web pages you're authoring, but now you want them to actually do something? And moreover, probably you want them to do something based on the information your visitor spent hours painstakingly filling out on your site. Otherwise, they might be upset that they bothered to accomplish the form filling in the first place, no?

Typically, once a form is filled in the user presses a submit button and is taken to a new page where something related to the information they entered is done. The trick here then is to understand how information is transmitted from the first page with the form on to the second page where they are taken to, and how to use it once it's there. No-one was born knowing this.

Redirecting a webpage

Don't get too excited now Poor-viewers, but Steven Hargrove has written a particularly straightforward and easy to follow guide about how to permanently redirect webpages, for instance if you move them to a new domain address. Nope, not just the HTML meta tag redirect. Proper hardcore 301s.

JAlbum - static web photo album software that is actually good

JAlbum: Box, camera and screen not includedJAlbum: Box, camera and screen not includedIn these Net 2.0 days of flickr, Imageshack, Yahoo photos and so on, it might seem like it's never been easier to publish your home snaps. That's probably because it's true. However, easy doesn't always equal perfect. Sometimes you might want to have a web-traditional photo gallery on your own website, so you have full control over addresses, formatting, content, size and so on.

SERP (hic)

Whilst the Poorhouse likes to conserve bandwidth costs by ensuring no-one ever locates this "treasure trove" of information, apparently some crazy webheads care whereabouts in the search engine results their website comes. As a gesture to those who do, there is an interesting tool from, a search engine optimisation type company, that allows you to see your site as a search engine does.

This is useful to ensure all your l33t code isn't making things hard for the poor hardworking googlebot. The tool also checks your links are working and offers various random-but-targeted bits of advice. It also shows you what your entry might look like should someone stumble on your site on the big boys' search engine.

HTML lesson #42: The only legitimate use of the greatly loathed <blink> tag

This pure fact comes to you courtesy of - impairing productivity since 1997.

Learn it well!

Griddled to perfection

Want to replicate your finest-but-complexist tabular data on the web? You'll no doubt want a grid provide visual clarity. Seeing as it's the year 2010(ish) of course CSS is the way to go. But when the Poorhouse wanted such an effect, it wasn't quite so obvious how to achieve. In an effort to spare the highs and lows of the technique for other amateur web-kidz, here's how we did it.

Assuming you don't want all your tables to look like grids, you'll want to work on a new class of <table>, called perhaps, pick word at random, "grid". Each cell aka <td> of the table wants to be entirely surrounded by borders to give the impression of individual rectangles. Let's use the power of CSS inheritance to make it so:

Syndicate content