Add exit() / return after header(). header("Location: xxx"); is HTTP command, it DOES NOT stop PHP execution.
Add echo mysql_error(); inside move() function, this might help you debugging this.
LIMIT in update looks suspicious to me, can we even use LIMIT with UPDATE?
If you create 'id' as an AUTO_INCREMENT PRIMARY KEY you don't need to type LIMIT anywhere (since it is unique anyway).
Read about "global" and variable visibility/scope.
2) You need to learn to solve these smaller issues for yourself...
I like that statement
