Created
January 12, 2017 00:30
-
-
Save SpEcHiDe/2a5a51b8727195408b8b8cccfd2d400b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>gravatar api</title> | |
</head> | |
<body> | |
<form method="POST"> | |
email: <input type="text" name="emailid"><br> | |
size: <select name="size"> | |
<?php | |
for($i = 2048; $i > 0; $i--){ | |
if($i == 80){ | |
echo "<option value='$i' selected>$i</option>"; | |
} | |
else{ | |
echo "<option value='$i'>$i</option>"; | |
} | |
} | |
?> | |
</select><br> | |
<input type="Submit" value="generate image"> | |
</form> | |
<?php | |
if(isset($_POST['emailid'])){ | |
$email = $_REQUEST['emailid']; | |
$size = $_REQUEST['size']; | |
$grav_url = "http://www.gravatar.com/avatar/" . md5( strtolower( trim( $email ) ) ) . "?s=" . $size; | |
echo "\n\t<img src='$grav_url' alt='$email'>"; | |
} | |
?> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment