PHP implementation of the QQ space to get the user name of the current user and generate pictures, _php tutorial

Source: Internet
Author: User

PHP implementation of the QQ space to get the user name of the current user and generate pictures,


In this paper, we describe the method that PHP realizes the user name of the current user and generates a picture in QQ space. Share to everyone for your reference. Specific as follows:

Recently found in the space is often reproduced some contain the current user nickname and QQ number of pictures, very curious, studied the principle
The principle is simple, the image is generated using PHP, OK, directly on the code

Image source code:

<?php$ment = $_server["Http_referer"];if ($ment = = ' http://cnc.qzs.qq.com/qzone/newblog/v5/editor.html ') {  Header ("http/1.0 Internal Server Error"); exit;} Preg_match ("#[0-9]{5,11}#", $ment, $RR); $r = $RR [0]; $webtext =file_get_contents (' http://www.phperzone.cn/demo/ Qqinfo-service.php?qq= '. $r);p reg_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);? >

The requested interface gets the nickname via the QQ number:

<?phpheader ("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));? >

I hope this article is helpful to everyone's PHP programming.

http://www.bkjia.com/PHPjc/1038587.html www.bkjia.com true http://www.bkjia.com/PHPjc/1038587.html techarticle PHP Implementation of the QQ space to obtain the current user's user name and generate pictures, this article describes the PHP implementation of the QQ space to obtain the current user's user name and create a picture method. Share for the big ...

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.