It's a common mistake. You take a flight, it's not until you land that the idea of signing up to a frequent flyer program occurs. So you do so but the miles you could have earned from the flight you have just taken are not eligible. This especially annoying if it's a long haul flight that's transcontinental and/or in business or first class, which accrues more frequent flyer air miles than economy. You don't usually have to sign up before you book the flight, just before you check-in.
So give it some thoughts. Decide whether you want to sign up with the airline you're flying with or with one of its partner airlines and make the most of your miles.
Here is some insight into the main airline alliances.