Gravatar image and PHP


Hi friends ,

When I noticed gravatar webpage , They told how to get gravatar image from our own

PHP code . So I tried and see today . I will  share my code with U 🙂


<html>
 <head>
 <?php
 $email = $_REQUEST['email'];
 $grav_url = "http://www.gravatar.com/avatar/" . md5( strtolower( trim( $email ) ) ) . "&s=20";
 ?>
 </head>
 <body>
 <div style = 'width: 500px; background :lightblue;padding :10px; margin: 0 auto; '>
 <form action = 'gravatar.php' method = 'POST'>
 Enter your Email : <input type = 'text' name = 'email'><br />
 <input type = 'submit' value = 'click'><br /><br />
 <img src="<?php echo $grav_url; ?>" alt="" />
 </body>
</html>

Output :

Give ur mail id and get ur gravatar image  🙂

. It was working 🙂

This is one line code to get gravatar image using PHP


$grav_url = "http://www.gravatar.com/avatar/" . md5( strtolower( trim( $email ) ) ) . "&s=20";

Note: U should have gravatar iamge 🙂 🙂

Advertisements

About sathia

Web developer at cloudmint
This entry was posted in ImageMagick and Python. Bookmark the permalink.

2 Responses to Gravatar image and PHP

  1. pras1130 says:

    usefull code da.. thanks….

  2. V.Ramachandran says:

    Nice post.
    Thanks for sharing.:-)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s