Pass value per link

0

I need to send a value through a link to another page:

<li><a href="" onclick="getPasta()" id="icons"><?php echo $this->translate('Download');?></a></li>

I tried to use this code for upload:

<script type="text/javascript">
        function getPasta(){
            var id = $(this).attr('id');
            $.post(
                    "../download/index.phtml", 
                    { pasta: "id" }
            );
        }
</script>

But it is not working. I also want to ask how I would capture this value on my landing page because I need the pasta:id value to be in a PHP variable.

    
asked by anonymous 21.08.2017 / 21:55

1 answer

0

Type like this:

<li><a href="../download/index.phtml?pasta=id_7" id="icons"><?php echo $this->translate('Download');?></a></li>

To get the value:

$peguei = $_GET['pasta'];
    
21.08.2017 / 22:00