Sending serial data with Ajax

Contains 2 variable arrays here
How can I include this series?

[grup_kim] => Array
            [0] => 1
            [1] => 2
    [emailler] => Array
            [0] =>
            [1] =>
            [2] =>
            [3] =>

    { "grup_kim" : "<?php echo $grup_kim; ?>", "dosyaekle" : "<?php echo $dosyaekle; ?>", "uyeler" : "<?php echo $uyeler; ?>", "emailler" : "<?php echo $emailler; ?>" }

Are you just trying to print valid json?

I don’t know exactly what json means,
I want to send form data from aa.php page to bb.php with ajax
Two of these data are arrays, others are normal singular

I did this temporarily
in aa.php
$grup_kim = implode(", ", $_POST['grup_kim']);

in bb.php
$grup_kim = array_map('trim', explode(',',$_POST['grup_kim']));

This is of course very inexperienced

So, what is that stuff? And maybe I can show a clean way to do what you want.

This example print_ () output

This post, 1 and 2

This post, contains mail addresses

And you want to merge them and send them to another script?

I’m posting these and others in a form with submit

input text
input tex

and I’m sending it to another page with ajax

So using JQuery, you would do something like this on that page:

        let data = $(this).closest('form').serialize();
    $.post('/api/user', data, function (data, status) {
        console.log('Status:' + status + "\nData: " + data);
        //obj = JSON.parse(data);
        .fail(function (data) {
            let obj = JSON.parse(data.responseText);

Sending all of this form to serialize

Thank you for your help
I write the result that I will try to try

Sponsor our Newsletter | Privacy Policy | Terms of Service