Can jQuery Submit function send hidden field value to the next page?
<p>I am trying to get the value of the hidden field to the next page using PHP's <code>$_POST</code> and submit the function via jQuery, but it does not work.</p>

<h3>Part of CSS OOP</h3>

<pre><code>   &lt;ul&gt;
        &lt;li class="selectable" id="cakeType-&lt;?= $cake-&gt;id ?&gt;"&gt;
         &lt;a href="?cakeType=&lt;?php echo ($cake-&gt;id); ?&gt;" title="Selecteer"&gt;
          &lt;?php if ($cake == $order-&gt;cakeType){?&gt;&lt;span class="checked"&gt;&lt;/span&gt;&lt;?php } ?&gt;
           &lt;img src="data/&lt;? echo $cake-&gt;id ?&gt;.jpg" alt="" width="50"     height="50" /&gt;&lt;/a&gt;
       &lt;/li&gt;&lt;?php } ?&gt;&lt;/ul&gt;
</code></pre>

<h3>My form</h3>

<pre><code> &lt;form  id="formhide" method="post"&gt;
            &lt;input name="img" type="text" value="" id="hiddenimg" action="stap2.php"/&gt;
            &lt;/form&gt;
</code></pre>

<h3>jQuery</h3>

<pre><code>$(function(){  
 $('a img').click(function(e) {
  var photo=$(this).attr('src');    
  $("#div1 img:last-child").remove() 
  $('#div1'). append('&lt;img src="' + photo + '" /&gt;') ;
  $('#hiddenimg').val(photo);
  console.log(  $('#hiddenimg').val()  );
  e.preventDefault();   
});
$('a.nextStep').click(function() {
    if (debug) { alert('submit!') };
    $('#formhide').submit();


});
</code></pre>

<h3>Next page as the form gets submited</h3>

<pre><code>$img=$_POST['img'];
echo $img; // the value of my hidden field does not show up i get error msg
$_SESSION['img']=$img;
</code></pre>

<p>What's wrong with the above code?</p>
