title: Javascript and PHP combination not working, dont know if I done it right
body: <p>I dont really know how to explain what I'm trying to do in the title but what I'm trying to do is I'm making an admin page where I can change my header and footer color across all pages with a button when inputting a color. so I wanted to include it all in one php file so it gets the color input and echos a javascript command that goes my :root property in my css and puts in the information then exits the .php file.</p>
  <p>I get no errors but for some reason when I press submit my colors do not change. Any ideas or help on what I could do?</p>
  <p>PHP</p>
  <pre><code>&lt;?php
  
  if (isset($_POST['Submit'])) {
      $primaryColorChange = $_POST['primaryChange'];
      
      
      require_once 'dbh-inc.php';
      require_once 'functions.inc.php';
  
      if (empty($primaryColorChange)) {
          header('location: ../adminPage.php?error=emptyinput');
          exit();
      }
  }
  else {
      header('location: ../adminPage.php?error=none');
      echo '&lt;script type=&quot;text/javascript&quot;&gt;',
       'const root = document.querySelector(&quot;:root&quot;);',
       'root.style.setProperty(&quot;--clr-primary&quot;, &quot;&lt;?php echo $primaryColorChange; ?&gt;&quot;);',
       '&lt;/script&gt;'
  ;
      exit();
  }
  </code></pre>
  <p>PHP/JAVASCRIPT</p>
  <pre><code>
          &lt;h1&gt;Input to change primary colors (header, footer, service borders)&lt;/h1&gt;
          
          &lt;form action=&quot;includes/changeColors.inc.php&quot; method=&quot;post&quot;&gt;
          &lt;input type=&quot;text&quot; name=&quot;primaryChange&quot; placeholder=&quot;#12345;&quot;&gt;
          &lt;br&gt;&lt;/br&gt;
          &lt;input type=&quot;submit&quot; name=&quot;changeColor&quot; value=&quot;Submit&quot;&gt;
          &lt;br&gt;&lt;/br&gt;
          &lt;/form&gt;
  
  </code></pre>