PHP全栈学习笔记25

news/2024/7/6 23:28:47
<?php
/*
*@Author: 达叔小生
**/
    header("content-type:image/png");   //设置页面编码        
    $num = $_GET['num'];            //获取超级链接传递的随机数
    $imagewidth=60;             //定义画布的宽
    $imageheight=18;                //定义画布的高
    $numimage = imagecreate($imagewidth,$imageheight);          //创建画布
    imagecolorallocate($numimage,240,240,240);              //设置画布颜色
    for($i=0;$i<strlen($num);$i++){                         //循环读取随机数
        $x = mt_rand(1,8)+$imagewidth*$i/4;
        $y = mt_rand(1,$imageheight/4);
        $color=imagecolorallocate($numimage,mt_rand(0,150),mt_rand(0,150),mt_rand(0,150)); //定义图像的颜色
        imagestring($numimage,5,$x,$y,$num[$i],$color);         //将随机数写入到画布中
    }
    for($i=0;$i<200;$i++){          //for循环语句生成干扰线
        $randcolor=imagecolorallocate($numimage,rand(200,255),rand(200,255),rand(200,255)); //定义颜色
        imagesetpixel($numimage,rand()%70,rand()%20,$randcolor);        //生成干扰线
    }
    imagepng($numimage);            //生成图像
    imagedestroy($numimage);            //释放资源
?>

转载于:https://www.cnblogs.com/dashucoding/p/11140261.html


http://www.niftyadmin.cn/n/2823432.html

相关文章

oracle 数据文件检查,重建控制文件, 数据文件检查点SCN到底来自哪里?

Oracle 10.2.0.4 , windows 2003关于重建控制文件后&#xff0c; 控制文件中的数据文件检查点SCN来自哪里&#xff0c; 有下面两种说法 &#xff1a;1. 用noresetlogs重建控制文件时&#xff0c;控制文件中datafile checkpoint SCN来自online logs 中的current log头部&…

centos7.2环境yum方式快速搭建lnmp环境nginx+mariadb+php-fpm

centos7.2环境yum方式安装nginxmariadbphp-fpm1.安装lnmp环境安装epel源yum install -y epel-release安装 MySQL PHP Nginx phpMyAdminYUM 源已经配置好了&#xff0c;现在直接安装 MySQL PHP Nginx phpMyAdmin&#xff1a;yum install -y mariadb mariadb-server nginx …

中断系统和程序中断方式

http://www.softwarehistory.net/h/E_Comp_ZuchengYuanli/67.php

路由访问控制列表原理和三种类型的详解

路由访问控制列表原理详解路由访问控制列表&#xff08;ACL&#xff09;是应用在路由器接口的指令列表&#xff08;即规则&#xff09;&#xff0c;用来告诉路由器&#xff0c;哪些数据包可以接收&#xff0c;哪些数据包需要拒绝。ACL可分为三种类型标准ACL&#xff1a;检查数据…

SQL Server-外部联接基础回顾(十三)

前言 本节我们继续讲讲联接类型中的外部联接&#xff0c;本节之后我们将讲述有关联接性能以及更深入的知识&#xff0c;简短内容&#xff0c;深入的理解&#xff0c;Always to review the basics。 外部联接 外部联接又分为左外部联接和右外部联接&#xff0c;使用关键字分别是…

缓冲、中断和DMA技术

http://www.360doc.com/content/10/0730/11/1871462_42465665.shtml

基于RSA的WEB前端密码加密方案

受制于WEB页面源码的暴露&#xff0c;因此传统的对称加密方案以及加密密钥都将暴露在JS文件中&#xff0c;同样可以被解密。 目前比较好的解决方案是WEB页面全程或用户登录等关键环节使用HTTPS进行传输。 另外一种解决方案就是通过RSA进行加密。 RSA是一种非对称加密&#xff0…

linux 多进程共享,linux多进程通讯---通过共享磁盘文件

文章目录1、举例#include #include #include #include #include #include #include int main (void){char buf[64];int i;printf ("read process pid: %d\n", getpid());int fd open ("data.txt", O_RDONLY);if (fd < 0){perror ("open");re…