I'd just start echoing all the variables to see exactly what is happening. For example inside the while loop you can do a print_r($data) to see the contents of the $data hash. Then you might also want to echo the $page variable to make sure it's being set properly.
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.