Note that there are some explanatory texts on larger screens.

plurals
  1. POCheck for valid gravatar (PHP)
    text
    copied!<p>I'm pretty new to PHP, so if you have any thoughts or suggestions to point me in the right direction, I'd be grateful.</p> <p>Trying to make a simple function to check if a user's email address translates into a valid Gravatar Image, but it seems gravatar.com has changed their headers.</p> <p>Using <code>get_headers('urlencoded_bad_email@example.com')</code> returns a 200 instead of 302.</p> <p>Here are the headers from a bad gravatar image, none of which seem to be able to help because they are identical to a valid gravatar image:</p> <pre><code>array(13) { [0]=&gt; string(15) "HTTP/1.1 200 OK" [1]=&gt; string(13) "Server: nginx" [2]=&gt; string(35) "Date: Sun, 26 Jul 2009 20:22:07 GMT" [3]=&gt; string(24) "Content-Type: image/jpeg" [4]=&gt; string(17) "Connection: close" [5]=&gt; string(44) "Last-Modified: Sun, 26 Jul 2009 19:47:12 GMT" [6]=&gt; string(76) "Content-Disposition: inline; filename="5ed352b75af7175464e354f6651c6e9e.jpg"" [7]=&gt; string(20) "Content-Length: 3875" [8]=&gt; string(32) "X-Varnish: 3883194649 3880834433" [9]=&gt; string(16) "Via: 1.1 varnish" [10]=&gt; string(38) "Expires: Sun, 26 Jul 2009 20:27:07 GMT" [11]=&gt; string(26) "Cache-Control: max-age=300" [12]=&gt; string(16) "Source-Age: 1322" } </code></pre> <p>p.s. I am aware of the <code>'&amp;amp;d'</code> parameter, but it will not serve my purpose. :)</p> <p><strong>EDIT:</strong></p> <p>Use <code>'?d'</code> instead of <code>'&amp;amp;d'</code>. Must be a gravatar.com 'thang.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload