Turns out that the post didn’t see $ip as $_POST[‘ip’] like it would in a usual case. Sorry for the unnecessary post.
I got it..
Not much help ya know..
Well I see the problem
when viewing single posts the variable $cat is not set, is there anyway to pull the category from the currently viewed post?
Thanks