Looks like that script depended on register_globals.
Instead of $word, you need to use $GET['word']. If you want to use $word, you have to explicitly define it:
$word = $_GET['word'];
Same for POST, SESSION, COOKIE variables. More information on these superglobal arrays can be found here: [man]variables.predeinfed[/man].
Also, instead of code such as
if ($word) {
, you should be using something like:
if (!empty($word)) {
or
if (!isset($_GET['word']))
You have a problem with your SQL code as well. Since you call [man]mysql_fetch_array/man in the if() statement before the loop, you're always losing the first value of the SQL result set. In fact, if you only have 1 result returned, it'll be as if
In addition, it appears as though you're vulnerable to SQL injection attacks. User-supplied data should never be placed directly into a SQL query! Instead, sanitize it with a function such as [man]mysql_real_escape_string/man.
EDIT: Ah, NogDog posted while I was typing. :p Also, something I forgot to mention; you shouldn't use the deprecated "<?" short tags. Instead, use the full "<?php" tags.