Flag of Bosnia during Islamic occupation (Ottomans).
It wasn't until the Ottoman Empire that the crescent moon and star became affiliated with the Muslim world. Legend holds that the founder of the Ottoman Dynasty, Sultan Osman I, had a dream in which the crescent moon stretched from one end of the earth to the other. Taking this as a good omen, he chose to keep the crescent and make it the symbol of his dynasty. There is speculation that the five points on the star represent the Five Pillars of Islam, but this is pure conjecture. The five points were not standard on the Ottoman flags, and it is still not standard on flags used in the Muslim world today.
The Ottomans also used a flag with a crescent. When the first Ottoman Caliph, Selim I assumed power, the religious flag and the national flag were separated.[1] While both flags featured a right facing crescent, the national flag was red and the religious flag green, and, at a later date a five-pointed star was added.[1] This type of flag has become the de facto Islamic flag, and is used, with variations, by multiple Muslim lands such as Algeria, Azerbaijan, the Comoros, Malaysia, Maldives, Mauritania, Pakistan, Tunisia, Turkey, Turkmenistan, the Turkish Republic of Northern Cyprus, Uzbekistan, and the Western Sahara.[1] As the crescent and star have no religious significance however, some Muslim scholars are against attaching these signs on mosques and minarets or using them to denote Muslim societies.
http://en.wikipedia.org/wiki/Islamic_flags