QQ空间获取当前用户名最近很流行在qq空间里转载带有当前用户的一些图片,简单研究一下其实就是利用php来创建的一个简单的图片。
' Y z; V: K- D' r生成图片 image.php:
0 L j u( {! ~$ H/ |[PHP] 纯文本查看 复制代码 <!--?php
$ment = $_SERVER["HTTP_REFERER"];
if($ment == 'http://cnc.qzs.qq.com/qzone/newblog/v5/editor.html'){
header("HTTP/1.0 500 Internal Server Error");
exit;}
preg_match("#[0-9]{5,11}#",$ment,$rr);
$r=$rr[0];
$webtext=file_get_contents('http://www.phperzone.cn/qqinfo-service.php?qq='.$r);
preg_match('#"nickname":"(.*?)"#',$webtext,$rr);
$rrr=$rr[1];
ob_clean();
header("Content-type:image/png");
$im=imagecreatefromjpeg("1.jpg");
$black = ImageColorAllocate($im, 56,73,136);
$rrr = mb_convert_encoding($rrr, "utf-8","UTF-8");
imagettftext($im,20,0,90,68,$black,"./simsun.ttc",$rrr);
imagettftext($im,26,0,87,125,$black,"./simsun.ttc",$r);
imagejpeg($im);
imagedestroy($im);
?--> 3 M$ Z9 U! f, J1 V7 t4 y! @
& E5 N, ]. P9 V( i% s' f
s$ j0 J: a1 I: e, m+ H" C接口文件 qqinfo-service.php:
% T0 m6 _) ?8 L# e0 p& b[PHP] 纯文本查看 复制代码 <!--?php
header("Content-Type:text/html;charset=utf-8");
$qq = $_GET ["qq"];
echo htmlspecialchars(file_get_contents('http://r.qzone.qq.com/cgi-bin/user/cgi_personal_card'. "?uin=" . $qq));
?--> 0 S+ u% t1 o& U# |6 x5 [4 ]
: E( O) L3 t( V$ K9 n2 T7 w1 D
7 I1 V: M, }9 u! M/ t源码下载 上传PHP空间
2 F* y* b4 _* ]1 ^# {
2 ?7 {) d5 c! \: ]* l" s
* y" a' f1 n6 l: o9 j( P$ I/ _. ?9 q# b# W$ n* z, i9 ^" L, K
|