PHP:Defing a global scope variable
<p>I am in a situation .</p>

<p>My php folder structure is like </p>

<pre><code>UI
  user
    login.php
    logout.php
  jquery
    somejs

  css
    somecss
blah.php
blah.php
</code></pre>

<p>Now to import any css ,js or any php file i am using the file path like </p>

<pre><code>localhost/UI/user/index.php  // example  
</code></pre>

<p>Now i am trying to define a global variable on any page like </p>

<pre><code> &lt;?php
    $somevar = "localhost";
    GLOBAL $somevar;
    ?&gt;   
</code></pre>

<p>So that i could import any css js like </p>

<pre><code>&lt;?php echo $somevar ;?&gt;/UI/user/index.php  // example  
</code></pre>

<p>Problem : It is working on that page only where i declared the variable as GLOBAL</p>

<p>I want to use the variable on each page and don't want to use include </p>

<p>Is there any other alternative to define a variable for files folder in php  ?</p>
