Code for rename.html:
Code: Select all
<form method="POST" action="rename.php">
Original File Name:   <input name="oldfile">
<br>
New File Name:   <input name="newfile">
<br>
<input type="submit">
</form>Code: Select all
<?php
$file_old= $_REQUEST['oldfile'] ;
$file_new = $_REQUEST['newfile'] ;
if(!rename($file_old, $file_new))
{
echo ("Your file was not renamed.");
}
?>I know that the echo should say Renaming Successful, but this code thinks the echo is the else, and vice versa.
I feel like a "noob", but how do I add an else? I tried this, but kept getting T_ELSE errors.
Thanks,
Alex