change the image name in php
<p>hello i have the following code to change the image name of upload picture <pre>
$TARGET_PATH="pics/";
$TARGET_PATH =$TARGET_PATH . basename( $_FILES['photo']).'.jpg';
while (file_exists($TARGET_PATH))
    {
$TARGET_PATH =$TARGET_PATH . basename( $_FILES['photo']) . uniqid() . '.jpg';
}</pre></p>

<p>This change the name of image or file but dont sho the extention it just show dot(.) at end of name i.e  1=>file.<br/>2=>filefile9534803.</p>
