Ajax Post PHP Variable : <p>I am sending some data using AJAX, I can get most of it working apart from the final data value.</p>

<p>I would like to declare a PHP variable at the beginning of my HTML file, then reference this in the AJAX post - is this possible?</p>

<p>MY code is;</p>

<pre><code>&lt;?php 
$location = 'My Office';
?&gt;

$.ajax({
    url: "my url",
    type: "post",
    data: {
        Feedback: feedbackVal,
        Date: date,
        Time: time,
        Location: &lt;?php echo $location; ?&gt;
    }
});
</code></pre>

<p>The error I receive in the console is;</p>

<blockquote>
  <p>Uncaught SyntaxError: Unexpected identifier</p>
</blockquote>

<p>Screenshot of console;</p>

<p><a href="https://i.stack.imgur.com/NJzTy.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/NJzTy.jpg" alt="enter image description here"></a></p>

<p>When I remove <code>Location</code> from the AJAX post the remaining data sends successfully. </p>

<p>Any help is appreciated.</p>
