Value of variable changing before function is finished running
<p>I have an image uploading script in which i use the following setup to assign names to uploaded images;</p>

<pre><code>        $saltdate = date( 'U' );
        $saltuser = $_SERVER[REMOTE_ADDR];
        $saltname = md5($saltdate.$saltuser);

// Recieve, Process, Save uploaded image

// Update database with image name
</code></pre>

<p>The problem that i encounter is that after processing/saving the image, when its time to add this file name to the database, the value of <code>$saltdate</code> seems to have changed and i will get a file name in the database that doesnt exist.</p>

<p><strong>EDIT</strong></p>

<p>The value has changed in that the time increases from when i name the file to when i store the name in the DB.</p>

<p>How can i make sure that the value doesn't change once i establish it?</p>
