I have this form:
<form class="getCurPd" method="get">
<input type="hidden" id="lastpid" name="lastpid" value="" />
</form>
With some javascript code I've given dynamic value for that input.And now need to use that value in php code. Here it is:
<?php
$cur = '<script type="text/javascript">jQuery(document).ready(function(){jQuery("#lastpid").val();})</script>';
$_terms = wp_get_post_terms($cur, 'product_cat');
foreach ($_terms as $_term) {
echo '<a style="color:#333;" href='.get_term_link($_term).'>product cat link</a>';
}
?>
But $cur isn't defined think that javascript syntax is wrong. Please help me find it.