Mapping texture to an sphere

I want to map a texture to a sphere. i have made the sphere using the gluQuadric functions. But how do i map the texture? someone who has some code on this?

Take a look at quadrics tut, there is one command to generate tex coords for quadrics.

I have an example on my site.