I was in Istanbul about this time last year, it is a really nice city visit.
Right before you hit immigration at the airport there's a booth where you buy the entry visa. You have to pay cash and at that time it was $45 I believe (the visa stamp says 45 euros on it).