可让软件读取更新的PHP页面
如果直接访问页面,会显示公开信息. 带p值访问,会显示隐藏信息.
不是什么新异的思路,刚才写个小软件需要用到自动更新,所以就写了这个PHP来让软件读取.
index.php是主页面,
up.php是上传附件页面,呃.这个页面貌似没什么用
1. [PHP]代码
index.php <?php //Y-m-d H:i:s任选 分别是取年月日时分秒 $n1="azhus.com".date("H"); //第一个权限 $n2="azhus".date("H"); //第二个权限 $p=$_POST['p']; //p为POST的p参数 if ($p==$n1) echo "版本:2;地址:http://bbs.vvell.com/201304/13175552.rar;"; //格式为"版本:**;地址:**;" 下同 elseif ($p==$n2) echo "版本:3;地址:http://bbs.vvell.com/201304/13175628.rar;"; else echo "公告:<br>来自爱注释论坛,http://azhus.com"; ?> up.php <? $fileup = 0; //上传功能开关 0打开 1关闭 $filesize = 200; //文件大小单位KB 1M=1024KB $filetype = array('jpg','gif','bmp','rar','zip','7z'); //文件类型 $filepath = './'; //文件保存目录 后面要加/ 不能超过两级目录 if ($_GET['up']){ if ($fileup) exit ('上传功能已关闭!'); $fileend = end(explode('.',basename($_FILES['file']['name'])));//取得后缀名 //判断文件类型和大小 if(in_array($fileend,$filetype) && $_FILES['file']['size'] < 1024*$filesize){ if (!file_exists($filepath)) mkdir ($filepath); //如果不是当前目录需要这句 判断文件保存目录是否存在 没有则创建 $filepath = $filepath.date('Ym').'/';//以年月作为目录 if (!file_exists($filepath)) mkdir ($filepath);//判断年月目录是否存在 没有则创建 date_default_timezone_set('PRC');//中国时间 $fileurl = $filepath.date('dHis.').$fileend;//文件路径 用日时分秒作为文件名 move_uploaded_file($_FILES['file']['tmp_name'],$fileurl);//把上传的文件移动到我们指定的文件路径 }else{ exit('<script>alert("文件大小或类型错误!");location="?";</script>'); } } ?> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <title>上传文件</title> </head> <body style="font-size:14px; line-height:25px;"> <? if($_GET['up']){ ?> <p> <strong>上传成功!</strong><br/>请复制文件地址: <input type="text" onClick="select();" value="<? if ($_GET['up']) echo $fileurl ?>" /><br/> 点文本框自动全选 Ctrl+C 复制 或 鼠标右键复制<br/> 在需要使用的地方 Ctrl+V 粘贴 或 鼠标右键粘贴 </p> <? }?> <? if($fileend=='jpg'||$fileend=='gif'||$fileend=='bmp'){ ?> <p><strong>图片预览</strong>:<br> <img src="<?=$fileurl?>"/></a></p> <? }?> <form method="post" action="?up=file" enctype="multipart/form-data"> <input name="file" type="file"><input type="submit" value="上传"> </form> <p><strong>大小:</strong><?=$filesize?> KB<br/><strong>类型:</strong> <? for($i=0; $i < count($filetype); $i++) echo $filetype[$i],' ' ?></p> </body> </html>
以上就是可让软件读取更新的PHP页面的内容,更多相关内容请关注PHP中文网(www.php.cn)!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics











PHP is mainly procedural programming, but also supports object-oriented programming (OOP); Python supports a variety of paradigms, including OOP, functional and procedural programming. PHP is suitable for web development, and Python is suitable for a variety of applications such as data analysis and machine learning.

PHP uses MySQLi and PDO extensions to interact in database operations and server-side logic processing, and processes server-side logic through functions such as session management. 1) Use MySQLi or PDO to connect to the database and execute SQL queries. 2) Handle HTTP requests and user status through session management and other functions. 3) Use transactions to ensure the atomicity of database operations. 4) Prevent SQL injection, use exception handling and closing connections for debugging. 5) Optimize performance through indexing and cache, write highly readable code and perform error handling.

PHP is used to build dynamic websites, and its core functions include: 1. Generate dynamic content and generate web pages in real time by connecting with the database; 2. Process user interaction and form submissions, verify inputs and respond to operations; 3. Manage sessions and user authentication to provide a personalized experience; 4. Optimize performance and follow best practices to improve website efficiency and security.

PHP is suitable for web development and rapid prototyping, and Python is suitable for data science and machine learning. 1.PHP is used for dynamic web development, with simple syntax and suitable for rapid development. 2. Python has concise syntax, is suitable for multiple fields, and has a strong library ecosystem.

PHP originated in 1994 and was developed by RasmusLerdorf. It was originally used to track website visitors and gradually evolved into a server-side scripting language and was widely used in web development. Python was developed by Guidovan Rossum in the late 1980s and was first released in 1991. It emphasizes code readability and simplicity, and is suitable for scientific computing, data analysis and other fields.

The core benefits of PHP include ease of learning, strong web development support, rich libraries and frameworks, high performance and scalability, cross-platform compatibility, and cost-effectiveness. 1) Easy to learn and use, suitable for beginners; 2) Good integration with web servers and supports multiple databases; 3) Have powerful frameworks such as Laravel; 4) High performance can be achieved through optimization; 5) Support multiple operating systems; 6) Open source to reduce development costs.

PHPhassignificantlyimpactedwebdevelopmentandextendsbeyondit.1)ItpowersmajorplatformslikeWordPressandexcelsindatabaseinteractions.2)PHP'sadaptabilityallowsittoscaleforlargeapplicationsusingframeworkslikeLaravel.3)Beyondweb,PHPisusedincommand-linescrip

PHP is suitable for web development and content management systems, and Python is suitable for data science, machine learning and automation scripts. 1.PHP performs well in building fast and scalable websites and applications and is commonly used in CMS such as WordPress. 2. Python has performed outstandingly in the fields of data science and machine learning, with rich libraries such as NumPy and TensorFlow.
