1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

Solved why cause err in this code?

Discussion in 'Development' started by korado531m7, Apr 28, 2018.

  1. korado531m7

    korado531m7 Slime

    Messages:
    77
    GitHub:
    korado531m7
    i wanna make input form
    and here's my code.
    PHP:
    $pk = new ModalFormRequestPacket();
    $form = array();
    $form["type"] = "custom_form";
    $form["title"] = "title test";
    $form["content"] = array("type" => "input","text" => "test","default" => "");
    $pk->formId 23;
    $pk->formData json_encode($form);
    $player->dataPacket($pk);
    but it doesn't work, cause err:
    Code:
    Received invalid form json. Error:
    /content: Invalid type for property. Expected 'array' got 'object'
    
    how to fix this? thank you for answering

    Add, solved
     
    Last edited: Apr 28, 2018
  2. Enrico Angelon

    Enrico Angelon Spider Jockey

    Messages:
    37
    GitHub:
    herryyt
    array(array("text" => "button1"));
    you need to add another array in it.
     
    Primus likes this.
  3. korado531m7

    korado531m7 Slime

    Messages:
    77
    GitHub:
    korado531m7
    Yes, i noticed
    Thank you
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.