That is not (inless you refer it to itself) an infinite loop ... and in any case, there's a timeout on such things in
PHP so they should not crash the server. It IS a script that is open to injection attacks as malicious site visitors could fillin your "category" box with something starting "
http://" or "/" and pick up code from other accounts on the same shared server, or other servers.
You should add code to check your "category" and "home" inputs to ensure that they only contain letters or digits, or validate them against a fixed list of whats's allowed, or something like that.
To get you started
if (! eregi('[a-z0-9]]+$',$_GET['category'])) { .....
will check if the category input is just letters and digits