显ip图片签名php,ip签名探针

ip签名探针

更新时间:2006年10月09日 00:00:00   作者:

可以用做签名,论坛头像

PHP代码:--------------------------------------------------------------------------------

/****************************************************

残风制作ip签名探针---stormor@163.com

如果有显示不正确的地方请发E-mail给我,以便修改!

*****************************************************/

Header("Content-type: image/png");

if(getenv("HTTP_CLIENT_IP")) {

$ip = getenv("HTTP_CLIENT_IP");

$ip_agent = getenv("REMOTE_ADDR");

} elseif(getenv("HTTP_X_FORWARDED_FOR")) {

$ip_real = getenv("HTTP_X_FORWARDED_FOR");

$ip_agent = getenv("REMOTE_ADDR");

} else {

$ip_real = getenv("REMOTE_ADDR");

$ip_agent = "";

}

if(!$ip_agent){

$wenzi="IP:";

$ip_count=strlen($ip_real);

$left=22;

$width=$ip_count*6+$left+5;

$height=14;

$picture=Imagecreate($width,$height);

$bgcolor=ImageColorAllocate($picture,225,250,225);

$bordercolor=ImageColorAllocate($picture,0,0,0);

$fontcolor=ImageColorAllocate($picture,0,0,0);

Imageline($picture,0,0,$width-1,0,$bordercolor);

Imageline($picture,0,0,0,$height-1,$bordercolor);

Imageline($picture,$width-1,$height-1,$width-1,0,$bordercolor);

Imageline($picture,$width-1,$height-1,0,$height-1,$bordercolor);

Imagestring($picture,2,2,0,$wenzi,$fontcolor);

Imagestring($picture,2,$left+2,0,$ip_real,$fontcolor);

Imagepng($picture);

ImageDestroy($picture);

}else{

$wenzi1="IP1:";

$wenzi2="IP2:";

$ip_count1=strlen($ip_real);

$ip_count2=strlen($ip_agent);

$left=26;

if($ip_count1>=$ip_count2){$width=$ip_count1*6+$left+5;}else{$width=$ip_count2*6+$left+5;}

$height=29;

$middle=$height/2+1;

$picture=Imagecreate($width,$height);

$bgcolor=ImageColorAllocate($picture,225,250,225);

$bordercolor=ImageColorAllocate($picture,0,0,0);

$fontcolor=ImageColorAllocate($picture,0,0,0);

Imageline($picture,0,0,$width-1,0,$bordercolor);

Imageline($picture,0,0,0,$height-1,$bordercolor);

Imageline($picture,$width-1,$height-1,$width-1,0,$bordercolor);

Imageline($picture,$width-1,$height-1,0,$height-1,$bordercolor);

Imageline($picture,$width-1,$middle-1,0,$middle-1,$bordercolor);

Imagestring($picture,2,2,0,$wenzi1,$fontcolor);

Imagestring($picture,2,$left+2,0,$ip_real,$fontcolor);

Imagestring($picture,2,2,$middle,$wenzi2,$fontcolor);

Imagestring($picture,2,$left+2,$middle,$ip_agent,$fontcolor);

Imagepng($picture);

ImageDestroy($picture);

}

?>

--------------------------------------------------------------------------------

相关文章

1a1b05c64693fbf380aa1344a7812747.png

PHP中实现进程间通讯...2006-10-10

4f55910a645b073bc4fc65dc10dc14bd.png

用文本文件制作留言板提示(下)...2006-10-10

0ea3c7666119d5615e582f823fb3fad6.png

将OICQ数据转成MYSQL数据...2006-10-10

4f96a78db829b1556ff16de21e013c7a.png

今天小编就为大家分享一篇关于PHP htmlentities()函数用法讲解,小编觉得内容挺不错的,现在分享给大家,具有很好的参考价值,需要的朋友一起跟随小编来看看吧2019-02-02

8cc1031babc6aff2319f1c6af8544aa0.png

其他功能...2006-10-10

0c932a99bb7b6f23c937db507070cc7b.png

php cookie实现的登录验证效果2009-03-03

cca732bf65a93ed2ec0ac80c638460fe.png

今天小编就为大家分享一篇关于PHP PDOStatement::getAttribute讲解,小编觉得内容挺不错的,现在分享给大家,具有很好的参考价值,需要的朋友一起跟随小编来看看吧2019-02-02

2d9f31f2af7b675a3d153d2b7f1035a7.png

有时候我们想先测试下mysql的用户名与密码是否正确,就可以参考下面的代码,很多情况下我们不知道是php错误,还是mysql用户名密码不对导致cms运行错误,可以先用下面的代码测试一下就可以了2013-08-08

b452cee8ec5cd9e58ab98eba17281e59.png

模拟SQLSERVER的两个函数:dateadd(),datediff()...2006-10-10

f4838ec7e2d4da28e0b57d4e852dadd4.png

怎么使 Mysql 数据同步...2006-10-10

最新评论

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值