Error while renaming file
<p>I have used a particular script for renaming the picture the if the file field is empty and username is changed. Username is what I need to save my image. Problem is arising on edit page... that if user don't want to change image and same time want to alter username, than according to me image should be renamed. But if file doesn't exist it is ending with warning message that I don't want... please help me if I can modify script in some what better way.</p>

<pre><code>if($file=="") {
$ext=substr($photo,strrpos($photo,"."));        

$newphoto="$name$ext";
//Gives warning message if file not exist..
rename( "poetpic/$photo","poetpic/$newphoto");}
</code></pre>
