Page 1 of 1

Rename files from a directory

Posted: Mon Jan 30, 2012 9:51 am
by FernandoBasso
I have this code:

Code: Select all

echo("<a href='$dir$arq'>$arq</a>
<a href=\"delfile.php?action=delete&filename=$dir$arq\"
 onclick=\"return confirm('Sure?')\">Deletar</a>
<a href=\"renfile.php?action=rename&filename=$dir$arq\">Renomear</a>
<br>");
When I clicke "Deletar", everything works fine. When I click rename, I see a URL similar to
"http://localhost:8080/Downloads/delfile ... _11_11.png"
and nothing shows in the page. Even "View Source" shows nothing.

This is the rename code I was preparing. It does nothing so far because since I can't at least
see the old name and nothing shows up I can't try to program any further.

Code: Select all

<?php
/* User clicou o link "Renomear". */
if ($_GET['action]' && $_GET['action'] == 'rename') {

    //$oldname = $_GET['filename'];
    echo $_GET['filename'];
    //echo("$oldname <br>");
}
?>

<p><a href='index.php'>InĂ­cio.</a></p>

Any help would be appreciated. Thanks in advance.