Home > Backend Development > PHP Tutorial > PHP implementation of displaying the current IP address on the picture_PHP tutorial

PHP implementation of displaying the current IP address on the picture_PHP tutorial

WBOY
Release: 2016-07-13 17:41:25
Original
793 people have browsed it

  1. $img = ImageCreate(180,50);
  2. $ip = $_SERVER[REMOTE_ADDR];
  3. ImageColorTransparent($img,$bgcolor);
  4. $bgColor = ImageColorAllocate($img, 0x2c,0x6D,0xAF); // Background color
  5. $shadow = ImageColorAllocate($img, 250, 0,0); // Shadow color
  6. $textColor = ImageColorAllocate($img, oxff,oxff,oxff); // Font color
  7. ImageTTFText($img,10,0,78 ,30,$shadow,"c:/windows/fonts/Tahoma.ttf",$ip);
  8. //Display background
  9. ImageTTFText($img,10,0,25, 28,$textColor,"c:/windows/fonts/Tahoma.ttf","your ip is".$ip);
  10. // Display IP
  11. ImagePng($img);
  12. imagecreatefrompng($img);
  13. ImageDestroy($img);
  14. ?>

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/486127.htmlTechArticle?php $img = ImageCreate(180,50); $ip = $_SERVER[REMOTE_ADDR]; ImageColorTransparent($ img,$bgcolor); $bgColor = ImageColorAllocate($img, 0x2c,0x6D,0xAF); // Background color $shadow = I...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template