PHP文件创建、复制、移动、删除文件
html代码如下:
- "content-type" content="text/html; charset=gb2312">
创建、复制、移动、删除文件 "350" border="1" cellpadding="0" cellspacing="0">
"350" height="80" border="0" cellpadding="0" cellspacing="0" background="images/326ssss.gif">
- method="post" action="index.php教程">
"95" height="39"> "171" rowspan="2" align="left" valign="middle"> "fopens" type="text" id="copy2" size="22"> "84" rowspan="2" valign="middle">"submit4" type="submit" id="submit4" value="提交"> "41"> "350" height="80" border="0" cellpadding="0" cellspacing="0" background="images/326s.gif">
- method="post" action="index.php">
"111" height="39"> "155" valign="bottom">"copys" type="text" id="copys2" size="20"> "84" rowspan="2" valign="middle">"submit" name="submit" value="提交"> "41"> "top">"copy2" type="text" id="copy22" size="20"> "350" height="80" border="0" cellpadding="0" cellspacing="0" background="images/326ss.gif">
- method="post" action="index.php">
"111" height="39"> "115" valign="bottom">"moves" type="text" id="moves3" size="20"> "84" rowspan="2">"submit" name="submit2" value="提交"> "41"> "top">"moves2" type="text" id="moves22" size="20"> "350" height="80" border="0" cellpadding="0" cellspacing="0" background="images/326sss.gif">
- method="post" action="index.php">
"104"> "236">"delete" type="text" id="delete2"> - "submit" name="submit3" value="提交">
php代码如下:
- if($submit=="提交"){
- $copy=$_post[copys];
- $copys2=$_post[copy2];
- if(copy($copy,$copys2)==true){echo "复制成功!!";}else{echo "失败!!";};
- }
- if($submit2=="提交"){
- $moves=$_post[moves];
- $moves2=$_post[moves2];
- if(rename($moves,$moves2)==true){echo "移动成功!!";}else{echo "失败!!";};
- }
- if($submit3=="提交"){
- $delete=$_post[delete];
- if(unlink($delete)==true){echo "删除成功!!";}else{echo "失败!!";};
- }
- if($submit4=="提交"){
- $fopens=$_post[fopens];
- if(fopen($fopens,"w")==true){echo "创建成功!!";}else{echo "失败!!";};
- }
- //开源代码phpfensi.com
- ?>