Outils pour utilisateurs

Outils du site


php:vizhash_gd_source

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentes Révision précédente
Prochaine révision
Révision précédente
php:vizhash_gd_source [2012/01/31 15:26]
sebsauvage
php:vizhash_gd_source [2014/07/12 12:26] (Version actuelle)
Ligne 2: Ligne 2:
 <file php vizhash_gd.php> <file php vizhash_gd.php>
 <?php <?php
-// VizHash_GD 0.0.beta+// VizHash_GD 0.0.beta
 // Visual Hash implementation in php4+GD // Visual Hash implementation in php4+GD
 // See: http://sebsauvage.net/wiki/doku.php?id=php:vizhash_gd // See: http://sebsauvage.net/wiki/doku.php?id=php:vizhash_gd
 // This is free software under the zlib/libpng licence // This is free software under the zlib/libpng licence
 // http://www.opensource.org/licenses/zlib-license.php // http://www.opensource.org/licenses/zlib-license.php
-$VERSION = "0.0.beta";+$VERSION = '0.0.beta';
 error_reporting(0); error_reporting(0);
-header("Cache-Control: max-age=2592000, public");+
 if (!isset($_GET['t'])) // Nothing to hash provided: We display the form if (!isset($_GET['t'])) // Nothing to hash provided: We display the form
  
-    header("Content-type: text/html"); +    header('Content-type: text/html'); 
     echo '<div style="font-family:Verdana,sans-serif; font-size:10pt;">VizHash_GD '.$VERSION.' - Visual Hash implementation in php4+GD.<br>';     echo '<div style="font-family:Verdana,sans-serif; font-size:10pt;">VizHash_GD '.$VERSION.' - Visual Hash implementation in php4+GD.<br>';
     echo 'See <a href="http://sebsauvage.net/wiki/doku.php?id=php:vizhash_gd">homepage</a> for more details.';     echo 'See <a href="http://sebsauvage.net/wiki/doku.php?id=php:vizhash_gd">homepage</a> for more details.';
Ligne 19: Ligne 19:
     echo '<input id="ok" type="submit" value="Hash" /></form>';     echo '<input id="ok" type="submit" value="Hash" /></form>';
     echo '<br>VizHash_GD accepts the following parameters:<br>';     echo '<br>VizHash_GD accepts the following parameters:<br>';
-    echo '<blockquote><b>t</b> : string to hash<br><b>width</b>: width of image (in pixels) (default:32, max:256)<br><b>height</b>: height of image (in pixels) (default:32, max:256)</blockquote><br>';+    echo '<blockquote><b>t</b> : string to hash<br><b>width</b>: width of image (in pixels) (default:80, max:256)<br><b>height</b>: height of image (in pixels) (default:80, max:256)</blockquote><br>';
     echo 'Examples: "hi"';     echo 'Examples: "hi"';
     $example_url=$_SERVER['PHP_SELF'].'?t=hi';     $example_url=$_SERVER['PHP_SELF'].'?t=hi';
Ligne 140: Ligne 140:
 drawshape($image,getInt(),$color); drawshape($image,getInt(),$color);
  
-header("Content-type: image/png");+// Image expires in 7 days (to lighten the load on the server) 
 +// and allow image to be cached by proxies. 
 +$duration=7*24*60*60; 
 +header ('Expires: ' . gmdate ('D, d M Y H:i:s', time() + $duration) . ' GMT'); 
 +header('Cache-Control: max-age='.$duration.', public'); 
 + 
 +// Prevent some servers to add "Pragma:no-cache" by default 
 +header('Pragma:cache'); 
 + 
 +header('Content-type: image/png');
 imagepng($image); // Return the image in PNG format. imagepng($image); // Return the image in PNG format.
 echo ' -- vizhash_gd '.$VERSION.' by sebsauvage.net'; echo ' -- vizhash_gd '.$VERSION.' by sebsauvage.net';
php/vizhash_gd_source.txt · Dernière modification: 2014/07/12 12:26 (modification externe)