When you are creating any application and want to display the users image on their profile page. This can be a better option for you to take users image from there Gravatar account, from where we can simply get the image using their email address.
<?php $email_id = "
[email protected]"; $default = ""; $size = 200; $gravatar_url = "http://www.gravatar.com/avatar/" . md5(strtolower(trim($email))) . "?d=" . urlencode($default) . "&s=" . $size; header("content-type: image/jpeg"); echo file_get_contents($gravatar_url); ?>
Copy above php script and use in your php code to show users gravatar in their profiles.