Place texture with mouse

Ive got an object and i would like to place texture on one of the sides with a specific position using a mouse click. The problem is if the object is rotated it doesnt place the texture at the correct spot. Could someone please help me with this.

You can solve this problem with the Selection Buffer. You should name each side and then use from the selection buffer and hit records to find the selected object.
This tutorial is so useful:
http://www.lighthouse3d.com/opengl/picking/
Hope this helps
-Ehsan-