Is that possible to pass a value without using form & hidden field? I try the ajax but not working. Below is my code
../order/?step=0 code:
<script>
jQuery(document).ready(function($){
var step0 = [];
var item = {
pid: 123,
qty: 1
};
step0.push({0:item});
data = JSON.stringify(step0);
$("a.base-product").click(function() {
$.ajax({
type: 'POST',
url: '../order/?step=1',
data: data,
});
});
});
</script>
<a class= "base-product" href="../order/?step=1">next</a>
After I click the next link, will need to ask the data from ajax to ../order/?step=1
../order/?step=1:
print_r($_POST);
But I get Array();
Or is that able to use the $_SESSION?