If you have super mario bros 2,

Here is tips on how to unlock the Mushroom, Flower, and Star worlds:

Mushroom World:

Go to the world one fortress and proceed as normal until you find the door where those green snakelike blocks, dry goombas, and the 5-50 coin block.  Follow the green blocks right into the wall, go through the gold pipe and keep going.  This will unlock the cannon that you use to arrive at the secret world.

 

Flower World:

Go to the world three fortress and make sure you have a mini mushroom on you. Keep going as normal up through the giant moving blocks until you reach the moving square stone blocks.  Follow the square thats going right and you'll see a mini warp pipe. Stay alive till you reach the red pipe and you'll reach the cannon.

 

Star World:

Defeat Bowser and you got it.