Building an Ajax Search Bar

WD_159Web Designer magazine have put one of the articles I wrote for them on Building an Ajax Search Bar up on their site. Originally published in Issue 159 of the magazine, this was part of a series introducing designers to programming in PHP and Javascript in order to turn their designs into  richer, more interactive Web apps. The whole series runs from issues 153 to 159 of the magazine, available from the Imagine eShop.

It’s worth noting that because of how we’d setup the PHP configuration in previous part of the series, there is no protection against SQL injection attacks in this tutorial. Out-of-the-box PHP installations back then came with the “magic_quotes_gpc” setting on, which would automatically escape incoming GET and POST variables. This is no longer the case, so you should take care to escape all input from the user.

In this case, you’d need to use the mysql_real_escape_string() function on the $SearchInput variable before running the database query in Step 12.

  1. No comments yet.

  1. No trackbacks yet.