The forums ran from 2008-2020 and are now closed and viewable here as an archive.
this code is virtually the same as what I’m using on another site and works perfectly yet is not working on another site. If you can highlight where I’m going wrong I would be grateful.
The code you have written above is perfect, I think it might be conflict with some one on live site.
Have look this tutorial, it might help you.