|No such thing as a small change|
Try this little script on your new server to see if your 'id' is even available.
You should close the handle for INF after the @data = <INF>; line.
Before you put yourself through hours of re-writing scripting, you may find that the environmental variable your looking for is named something else, or may not be turned on in the config file for the server.
The Admin for the server should know.
I have been through changing over to new servers in the past and un-wisely spent hours beating my head against the keyboard trying to trouble shoot a script only to find out that the new server didn't provide all the same environmental variables.
By running the script provided, or something similar, you might be able to save yourself a few bruises.
If the server is a shared hosting situation, the tech support should be able to turn on the variable for you, or may tell you to over-ride it in your own .htaccess file.
It will save you hours of time in coding, and give you a better understanding of how to control and secure/protect your website from unwanted guest, and to better use the server resources to enhance your scripting.
Best of Luck to you