0

i have form file delete anybody can help make file clone instead of delete.

<?php

if(isset($_POST['filed'])){
   unlink($_POST['file']);
}

?>



<form action="delet.php" method="post">
<b>Name of file(on the server):</b><INPUT type='text' Name='file'><Br>
<INPUT type='Submit' Name='filed' Value='Delete File'>
</form>  

Edited by kaakka: mistake

2
Contributors
4
Replies
31
Views
3 Years
Discussion Span
Last Post by kaakka
0

not working

    <?php
  if(isset($_POST['filed'])){
    rename($_POST['file']);
    }
    ?>
1

You cannot just do this

 <?php
    if(isset($_POST['filed'])){
    rename($_POST['file']);
    }
?>

and expect for the magical moments to occur. The reason I have provided you with the link above is for you to use them as reference and to learn more about them.

the rename function syntax is like this

rename("directory_where_file_is_located/name_of_the_file_to_be_rename.ext", "directory_where_the_renamed_file_is_to_saved/new_name_of_the_file.ext");
0

hello veedeoo
why asking help? becuase i am new to php get me better help don't hesitate.
just update below whatever showing rename purpose.

 <?php
if(isset($_POST['filed'])){
rename($_POST['file']);
}
?>
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.