|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2011-06-30 02:02 UTC] shuklaraje81 at yahoo dot com
Description: ------------ --- From manual page: http://www.php.net/function.rename%23Examples --- <?php if($_POST) { rename("/test2/conn.php", "/test2/conn2.php"); } ?> <form name="frm0" action="" method="post"> name<input type="text" name="txtname" value="" /> <input type="submit" value="submit" name="submit" /> </form> Expected result: ---------------- ihave a file in the test folder i wnt to copy this file in the test1 folder with different name my script name is try that is lay in the test2 folder all these three folder a lay in the C:\wamp\www\Rekha path please sir give the answer what code error PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Nov 03 23:00:01 2025 UTC |
rename("/test2/conn.php", "/test2/conn2.php"); works on windows, why do you think that it should be used? Tyraelto answer the original question: your script doesn't work, because you are using absolute paths (starting with /), but as you mentioned, your directoris are under "C:\wamp\www\Rekha". the suggested solution from Florian should work, but rename("./test2/conn.php", "./test2/conn2.php"); see the dots which means those paths are relative paths. Tyrael