2
Hiya,
I have looked over your code and I can see one small issue that could be the source of your problem.
You have an if statement that uses your post var (referee) and in side that if statement you have two 'cases' but I do not see where you have defined the '$case' switch for them. So the scipt just runs right by the two case statements (ignoring them).
You need to tell the script which case statement to use. either 'main' or 'main' using the $case var (Seems that is empty by your script)
Catz