PHP files to create, copy, move, delete files

Source: Internet
Author: User
Keywords Network programming PHP tutorial
Tags content copy create creating css tutorial delete delete files deleting

<head>
<meta http-equiv = "content-type" content = "text / html; charset = gb2312">
<title> Create, copy, move, delete file </ title>
<style type = "text / css tutorial">
<! -
body {
margin-left: 00px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
->
</ style> </ head>
<body>
<table width = "350" border = "1" cellpadding = "0" cellspacing = "0">
<tr>
<td> <table width = "350" height = "80" border = "0" cellpadding = "0" cellspacing = "0" background = "images / 326ssss.gif">
<form name = "form1" method = "post" action = "index.php tutorial">
<tr>
<td width = "95" height = "39"> </ td>
<td width = "171" rowspan = "2" align = "left" valign = "middle"> <input name = "fopens" type = "text" id = "copy2" size = "22"> </ td>
<td width = "84" rowspan = "2" valign = "middle"> <input name = "submit4" type = "submit" id = "submit4" value = "Submit"> </ td>
</ tr>
<tr>
<td height = "41"> </ td>
</ tr>
</ form>
</ table> </ td>
</ tr>
<tr>
<td> <table width = "350" height = "80" border = "0" cellpadding = "0" cellspacing = "0" background = "images / 326s.gif">
<form name = "form1" method = "post" action = "index.php">
<tr>
<td width = "111" height = "39"> </ td>
<td width = "155" valign = "bottom"> <input name = "copys" type = "text" id = "copys2" size = "20">
</ td>
<td width = "84" rowspan = "2" valign = "middle"> <input type = "submit" name = "submit" value = "Submit"> </ td>
</ tr>
<tr>
<td height = "41"> </ td>
<td valign = "top"> <input name = "copy2" type = "text" id = "copy22" size = "20"> </ td>
</ tr>
</ form>
</ table> </ td>
</ tr>
<tr>
<td> <table width = "350" height = "80" border = "0" cellpadding = "0" cellspacing = "0" background = "images / 326ss.gif">
<form name = "form1" method = "post" action = "index.php">
<tr>
<td width = "111" height = "39"> </ td>
<td width = "115" valign = "bottom"> <input name = "moves" type = "text" id = "moves3" size = "20">
</ td>
<td width = "84" rowspan = "2"> <input type = "submit" name = "submit2" value = "Submit"> </ td>
</ tr>
<tr>
<td height = "41"> </ td>
<td valign = "top"> <input name = "moves2" type = "text" id = "moves22" size = "20"> </ td>
</ tr>
</ form>
</ table> </ td>
</ tr>
<tr>
<td> <table width = "350" height = "80" border = "0" cellpadding = "0" cellspacing = "0" background = "images / 326sss.gif">
<form name = "form1" method = "post" action = "index.php">
<tr>
<td width = "104"> </ td>
<td width = "236"> <input name = "delete" type = "text" id = "delete2">
<input type = "submit" name = "submit3" value = "Submit"> </ td>
</ tr>
</ form>
</ table> </ td>
</ tr>
</ table>
</ body>
</ html>

php code

<? php session_start ();
if ($ submit == "Submit") {
$ copy = $ _ post [copys];
$ copys2 = $ _ post [copy2];
if (copy ($ copy, $ copys2) == true) {echo "copy successfully !!";} else {echo "failed !!";};
}
if ($ submit2 == "Submit") {
$ moves = $ _ post [moves];
$ moves2 = $ _ post [moves2];
if (rename ($ moves, $ moves2) == true) {echo "move successfully !!";} else {echo "failed !!";};
}

if ($ submit3 == "Submit") {
$ delete = $ _ post [delete];
if (unlink ($ delete) == true) {echo "delete successfully !!";} else {echo "failed !!";};
}
if ($ submit4 == "Submit") {
$ fopens = $ _ post [fopens];
if (fopen ($ fopens, "w") == true) {echo "created successfully !!";} else {echo "failed !!";};
}

?>

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.