php/libravatar.php: add size. & Gravatar.php: remove px.

This commit is contained in:
Mikaela Suomalainen 2014-06-30 13:08:52 +03:00
parent 77dcc8bbab
commit 2cf74b82e5
2 changed files with 12 additions and 4 deletions

View File

@ -19,7 +19,7 @@ Size: <input type="text" name="size">
<p>* marks required field. Only email address is required.</p>
<p>Size can be anything from 1 to 2048. If it's empty, size is
80px.</p>
80.</p>
<p>For Steam profile pictures, set size as 184.</p>

View File

@ -10,19 +10,27 @@
<p>
<form action="libravatar.php" method="post">
Email address: <input type="text" name="email">
*Email address: <input type="text" name="email"><br>
Size: <input type="text" name="size">
<input type="submit">
</form>
</p>
<p>* marks required field. Only email address is required.</p>
<p>Size can be anything from 1 to 2048. If it's empty, size is 80.</p>
<p>For Steam profile pictures, set size as 184.</p>
</body>
</html>
<?php
$email = trim( $_REQUEST["email"] );
$size = $_REQUEST["size"];
echo "<p>Email<br> $email</p>";
echo "<p>Email<br> $email<br></p>";
$email = strtolower( $email );
@ -34,7 +42,7 @@ if($md5email != "d41d8cd98f00b204e9800998ecf8427e") {
echo "<p>md5<br> $md5email</p>";
echo "<p>Link<br>";
$libravatar = "https://seccdn.libravatar.org/avatar/$md5email.jpg";
$libravatar = "https://seccdn.libravatar.org/avatar/$md5email?s=$size.jpeg";
echo "$libravatar</p>";
echo "<p>";
echo "<img src=$libravatar>";