title: ajax not working for getting url value stored in a constant
body: <p>hello everyone i am beginner in js/ajax and php so sorry in advance if u feel my question is a childish one i am have define the site url in my config file</p>
  
  <p>config.inc.php</p>
  
  <p>$config['siteurl']= "http://".$_SERVER['SERVER_NAME']."/abc";</p>
  
  <p>define('siteurl', $config['siteurl']);</p>
  
  <p>now on my page em including the config file and i checked i am greeting the url value but what i want is to print the value in window.location.heref="" here my function</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>$('#form_id').submit(function (e){
      var $this = $(this);
      e.preventDefault();
      $.post($this.attr('action'), $this.serialize(), function (responseData) {
     if(responseData == "success"){
      window.location.href =  &lt;?php echo (siteurl) ?&gt;;
     } 
     else if (responseData){
       swal({
           title: "Error!",
            text: responseData,
            type: "error",
            confirmButtonText: "ok"
            });
     }
        
      
  
      });
  });</code></pre>
  </div>
  </div>
  </p>
  
  <p>if i use  window.location.href= " <a href="http://localhost/abc/abc.php" rel="nofollow noreferrer">http://localhost/abc/abc.php</a>"; it works fine</p>