A
A
Andrew2012-03-16 13:01:10
PHP
Andrew, 2012-03-16 13:01:10

Question about the Gravatar service

At the request of the browser, the service returns either an avatar attached to the mail or a default picture.

Is it possible using PHP to find out if there is an attached avatar or not? If there is, we show it, if not, we don’t show anything at all (and not the default one).

Answer the question

In order to leave comments, you need to log in

2 answer(s)
K
kaluzhanin, 2012-03-16
@dasty

Request an avatar with the parameter ?d=404. Then gravatar will return 404 if there is no avatar.

E
eu22, 2012-03-16
@eu22

In the GET parameter d or default, you can specify the url of the image that will be displayed if there is no avatar, in your case it can be 1 transparent pixel.
Details here:
en.gravatar.com/site/implement/images/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question