Well, basically, the problem is this line:
if (!IsSet($display))
In newer versions of PHP (since 4.2), $display won't yet have a value (for security reasons that behaviour was turned off).
Instead, you get at the values of variables passed to the script in the querystring by looking in the $GET[] array. Ditto for forms that use the GET method, while forms that use the POST method use $POST.
Since you want the 'display' variable, you want to look at $GET['display']. I.e.,
if (!IsSet($_GET['display']))
and ditto for other occurrences of the variable.