Populate form input field with php variable value
<p>I have an html form and I need to populate one of the input fields with the url of the page the form is on. To get the url I have:</p>

<pre><code>&lt;?php $pageURL="http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];?&gt;
</code></pre>

<p>To populate the input field I have: </p>

<pre><code>&lt;script type="text/javascript"&gt;
// &lt;![CDATA[   
$(document).ready(function(){
    var getLabel = $(".monkForm label:contains('Page URL')");
    var getFor = getLabel.attr('for');
    var splitFor = getFor.split('_');
    var inputID = $("#" + getFor );
    var wrapID = $("#w" + splitFor[1] );
    wrapID.hide();
    inputID.val('&lt;?=$pageURL;?&gt;');
});
// ]]&gt; 
&lt;/script&gt; 
</code></pre>

<p>The input field label on the form is "Page URL". The problem is that the page URL is not being added to the input field.  </p>
