一些常用的php简单命令代码集锦

yipeiwu_com6年前PHP代码库
删建:
 引用
if(file_exists("file.htm"))// 检查是否存在此文件
if(file_exists("chat"))//检查是否存在此文件夹
rename('index.php','index'); //将index.php 改名为 index
fopen("name.php","a+"); //建立文件
mkdir("boot","0777"); //建立文件夹且设置属性为777
rmdir ("include");//删除文件夹
unlink("index.php");//删除文件 

数据库的查询:
 引用
$db = new db_query;
$db->connect();
$db->query("DROP DATABASE $DbName;");//$dbname 为数据库名

连接:
 引用
header("location:index.php");//转到网页
echo "第二步:请选择是否删除所有文件[聊天室]<br>";//写出代码
unset($tmp); //清除原有缓存
require("global.php");//缓存
print <<< eot //写出代码
eot;

相关文章

用PHP实现图象锐化代码

<?   //读取图像的类型     //1 = GIF, 2 = JPG, 3...

PHP中file_exists与is_file,is_dir的区别介绍

很显然file_exists是受了asp的影响,因为asp不但有fileExists还有folderExists,driverExists,那么PHP中file_exists是什么意思呢...

PHP获取数组最大值下标的方法

本文实例讲述了PHP获取数组最大值下标的方法。分享给大家供大家参考。具体实现方法如下: <?php $hots = array('8213'=> 0,'8212'...

php实现上传图片文件代码

代码很简单,这里我们就不多废话了,直接奉上源码 <?php // 注册表单的姓名 $name=""; $nameErr=""; if ($_SERVER["REQUES...

PHP运行出现Notice : Use of undefined constant 的完美解决方案分享

Notice: Use of undefined constant ALL_PS - assumed 'ALL_PS' in E:\Server\vhosts\www.lvtao.net...