An enemy is just around a corner and isn't visible to a player who decides to move (unknowingly) past the enemy during combat. The enemy has a higher initiative and has chosen to ready their attack in case somebody goes by them.
If the player is simply moving (not running or charging) does the enemy get to use their readied attack as well as to perform an attack of opportunity (both immediately and without the player being able to do anything about it)? Perhaps the rules are really clear about this, but my personal feeling is as follows:
The player's movement into the adjacent square immediately triggers the readied attack. If the player is actually struck, they would become aware of the opponent and decide not to continue blindly moving towards their original target. This means that the attack of opportunity that would result from moving out of a threatened square wouldn't occur unless the player actually wants to continue moving forward. In the event that the readied attack misses perhaps the player would continue on unaware, setting off the attack of opportunity.
Or not :) I am probably wrong in my assumption here.
For further detail the corner is what is hiding the opponent (no invisibility or darkness). Imagine moving past a hallway entrance that intersects (ie t-intersection) the hallway the pc is trying to move down. So the pc is moving down a straight hallway. As they pass the hallway entrance the enemy hiding there makes their triggered readied attack.
The GM seemed to really want two attacks to happen, but I questioned whether or not they would if the first attack was a hit :) I felt that the pc should be given the chance to stop their movement and prevent the inevitable attack of opportunity.
In the case of the readied attack missing and not being noticeable, I would expect an immediate attack of opportunity to be valid.