Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > Beginning PHP
|
Beginning PHP Beginning-level PHP discussions. More advanced coders should post to the Pro PHP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning PHP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 14th, 2006, 11:44 AM
Authorized User
 
Join Date: Dec 2003
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Default rename warning error

When I try to use rename I get an error:

Warning: rename(./x.JPG;,./v.jpg;): No such file or directory in /home/content/html/test/index.php on line 27

Am I using it correctly? Here is a snip from my code:

24 $ext = findexts ($old_name) ;
25 $new_name = str_replace(" ", "-", $new_name);
26 $new_name = $new_name . '.' . $ext;
27 rename ("./".$old_name, "./".$new_name);

Is there some way to specify the current directory? Some syntax error?

Thanks!




 
Old January 10th, 2007, 02:32 AM
Friend of Wrox
 
Join Date: Oct 2003
Posts: 479
Thanks: 0
Thanked 3 Times in 3 Posts
Send a message via MSN to surendran Send a message via Yahoo to surendran
Default

hai,
don't use dot(.) there if you using your directory back use two dots(..) or levae without put and dots.

surendran
(Anything is Possible)
http://ssuren.spaces.msn.com
 
Old January 10th, 2007, 06:23 AM
Authorized User
 
Join Date: Dec 2006
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to paagle
Default

yeah dots get things confusin and make sure that u gave enough privilages or whatever they call it in php.ini file and make sure that the file doesnot exist from before
i mean one with the new name

---
Paagle
TEAM LEADER-Team Xuberance(http://www.xuberance.com)





Similar Threads
Thread Thread Starter Forum Replies Last Post
Compile Error when running LNC Rename Add-in Dhanick Access 1 December 1st, 2008 08:55 AM
log4j warning. and error. sureshrgsl Apache Tomcat 0 April 16th, 2007 03:08 AM
LNC Rename control Add-in error jbage BOOK: Expert One-on-One Access Application Development 7 March 22nd, 2007 08:41 AM
fixing the 'headers already sent' warning/error ire BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 1 August 21st, 2006 07:35 AM
Warning error, please help! kscritch BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 3 December 12th, 2005 04:33 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.