iPhones can鈥檛 always figure out which way is up. There are plenty of times when you鈥檙e lying down or leaning back that the phone鈥檚 screen keeps shifting from portrait to landscape 鈥 now it鈥檚 portrait... and back to landscape. There is a way to stop this constant screen rotation.
First, double-click the iPhone home button. This will bring up a list of recently opened apps. Swipe from left to right. That will reveal a set of music controls 鈥 stop, play, skip track, etc. Ignore those for right now because we鈥檙e interested in the far-left button 鈥 that gray icon with a circular arrow. Touch the icon and a message will come up reading, 鈥淧ortrait Orientation Locked.鈥 Now, it doesn鈥檛 matter if you鈥檙e reading a text message sideways on a roller coaster, your screen will stay vertical.
If you can鈥檛 remember whether your screen has been locked or not, check for the lock icon next to your battery indicator in the top-right corner. Curiously, this trick only works vertically. You can't lock it to a horizontal orientation.