define a local and live environment path
<p>I'm using a form to upload files into a specific upload folder.
Now, in my local development environment, the local folder is harcoded in a variable like this</p>

<pre><code>$destination = 'c:/public_html/discography/artwork/';
</code></pre>

<p>Once the script is completed and ready to be moved in the live environment, the upload folder will be</p>

<pre><code>$destination = '/home/my_name/public_html/discography/artwork/';
</code></pre>

<p>My question is the following:
Right now, both variables are hard coded. How do i make it so depending on the environment, the correct path is selected?</p>

<p>If possible, i'd like it to be in a define statement, so i can use it anywhere in my script:</p>

<pre><code>define('UPLOAD_ARTWORK', ????);
</code></pre>

<p>local:</p>

<pre><code>$destination = 'c:/public_html/discography/artwork/';
$move = move_uploaded_file($_FILES['artwork']['tmp_name'], $destination.$_FILES['artwork']['name']);
</code></pre>

<p>live:  </p>

<pre><code>$destination = '/home/my_name/public_html/discography/artwork/';
$move = move_uploaded_file($_FILES['artwork']['tmp_name'], $destination.$_FILES['artwork']['name']);
</code></pre>

<p>wishing for </p>

<pre><code>define('UPLOAD_ARTWORK', ????);
$move = move_uploaded_file($_FILES['artwork']['tmp_name'], UPLOAD_ARTWORK.$_FILES['artwork']['name']);
</code></pre>

<p>Thanks</p>
