Hi,
Your logic is totally wrong.
You can't simply check one cell if it's X or O, then determine if Player 1 or Player 2 is the winner. There's quite a bit more to it.
Basically, you have the following winning combinations:
Top across, Middle across, bottom across. Left down, Middle down, Right down. Left diagonal, Right Diagonal.
That's 8 combinations. What I'd do, is generate an array with 9 cells. That looks something like this:
1 2 3
4 5 6
7 8 9
Then, you pass that array to a function/class to check. You have predefined rules, which, if match, you can determine a winner.
Hope this helps.
Kevin