Passing parameters from one page to another in PHP

2

I have a data listing on a page. There an 'editing image' serves as a link to another page where this data is displayed again (in addition to the other client data) and it is possible to edit them. As follows, the destination page is edit.php

In this link I want to pass the client ID parameter so that on the edit.php screen I can manipulate this client and display their data again. All via POST.

I had thought of something like: href="edit.php? fields ('id_user');? >"

    
asked by anonymous 05.08.2015 / 16:41

1 answer

1

Friend,

For you to send the userid via post, you will have to send it with ajax.

It would look something like this:

$('#link').click(function(e){  
                e.preventDefault();
                var valores = $('#link').serialize()
                console.log(valores);
                $.ajax({
                url : editar.php',
                type: 'post',
                dataType : 'html',
                data: valores,
                beforeSend : function(){
                    $('#carregando').show('100');
                },
                //colocamos o retorno na tela
                    success : function(pre){
                        $('#carregando').hide('100');
                        $('#retorno').find('strong').text(pre).end().show(100);
                    } 
                });
            });
        });
    
05.08.2015 / 16:53