Chapter 12. Visualizing your Data... and More!: Drawing dynamic graphics

image with no caption

Sure, we all know the power of a good query and a bunch of juicy results. But query results don’t always speak for themselves. Sometimes it’s helpful to cast data in a different light, a more visual light. PHP makes it possible to provide a graphical representation of database data: pie charts, bar charts, Venn diagrams, Rorschach art, you name it. Anything to help users get a grip on the data flowing through your application is game. But not all worthwhile graphics in PHP applications originate in your database. For example, did you know it’s possible to thwart form-filling spam bots with dynamically generated images?

Guitar Wars Reloaded: Rise of the Machines

The future is now. Robots have already been let loose in the virtual world and there isn’t much to stop them other than some PHP coding vigilance. The robots are spam bots, which troll the Web for input forms that allow them to inject advertisements. These robots are chillingly efficient and care nothing about the intended usage of the forms they attack. Their one and only goal is to overrun your content with theirs in a bloodthirsty conquest of ad revenue for their masters. Sadly, the Guitar Wars high score application has fallen prey to the bots.

All web forms are at risk of attack from spam bots.

Spam bots excel at mindless repetition, in this case filling ...

Get Head First PHP & MySQL now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.