用PHP实现动态按钮


<?php /************************************************************** * 动态按钮 * * http://justice.loyola.edu/~rcapelli/dynamic_button/ * * * * 作者: Rob Capellini * * 最后更改日期: 1999年3月22日 * * 注意:以下这段程序中有很大一部的代码是来源于其它人的程序,我 * 只不过把它们组合起来了,为此,我不能也不会为了下面的程序 * 而取得值得荣誉的感觉。我只是加入了一些功能性的东西。 * *比如: * * http://www.phpbuilder.com/columns/rasmus19990124.php3 * http://webdev.berber.co.il/get_example.php3?count=402 * * 这个程序是通过了GD Library创建了具有动态性的按钮,就像IE上的一样, *在这个程序中,你可以改变按钮的大小、文字、字体、字体大小 **************************************************************/ /* "gd.so" 是 GD library 文件,在 GNU\Linux 中必须的文件 */ /* 提示:如果是在Windows下,该文件应该是——PHP_GD.DLL */
dl( "gd.so");
/* 我们还需要 Radloff Claus' 的colors.php 文件 */
require( "colors.php");
/*设置一些初始化变量 */
$BaseFontDir = "../ttf/";
$Fontname = "TIMES";
$sz = 11;
$fgcolor = "white";
$bgcolor = "blue";
$xpad=9;
$ypad=9;
$text= "This text is the default text.";
/*从 URL中得传来的参数 */
$query_string = getenv( "QUERY_STRING");
/* 以&为界限折分参数 */
$env_array = split( "&", $query_string);
/* 把参数名和值拆分出来,并把值转成 %XX 形式 */
while (list($key, $val) = each($env_array)) {
list($name, $wert) = split( "=", $val);
$name = urldecode($name);
$wert = urldecode($wert);
// 写入 $cgivars
$CGIVars[$name] = $wert;
} 本文作者:
« 
» 
快速导航

Copyright © 2016 phpStudy | 豫ICP备2021030365号-3