title: $_SERVER['DOCUMENT_ROOT']
body: <p>First of all, if you read this, thank you in advance for your patience,- I'm fairly new at PHP and have an issue which I will try to explain/describe. </p>
  
  <pre><code>//set default path
  ///var/www/vhosts/www.mydomain.com/httpdocs/
  $url = 'http://mydomain.com/skins/coolblue/tmp';
  $url2 = 'http://mydomain.com/skins/coolblue/tmp';
  $doc = $_SERVER['DOCUMENT_ROOT'];
  $path = '/templates/';
  $actual_url = $doc.'/skins/coolblue/tmp'.$path;
  </code></pre>
  
  <p>(I had a developer originally build my site and configure my server, but he's gone now)
  my site is hosted on a dedicated server with plesk control panel, so when I called Godaddy and asked them the value for <code>['DOCUMENT_ROOT']</code>, they gave me <strong>* /var/www/vhosts/www.mydomain.com/httpdocs/*</strong></p>
  
  <p>my issue is, I use dynamic urls eg subdomain.mydomain.com(which is already configured and works properly), which in turn determines content, and being that the output comes from a particular script using the <code>$_SERVER['DOCUMENT_ROOT']</code> as above, the url is always the static  url in the www.++++ format.  I want the url to be dynamic.</p>
  
  <p>Is there a way to go around this, or can I change the $doc = <code>$_SERVER['DOCUMENT_ROOT'];</code> to the actual url of the script and add in the dynamic domain variable ie <code>http://$subdomain/domain.com</code>? I have tried just about every variation of the path with no luck. Do you have any suggestions? As an aside, is <code>$doc = $_SERVER['DOCUMENT_ROOT'];</code> a necessary, or was it the choice of the developer instead of writing the path out? - Thank you again</p>