Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Communication PMMP<=>SITE

Comments in 'Plugin Development' started by musaichi, Feb 23, 2016.

  1. musaichi
    Offline

    musaichi New Member

    Joined:
    Mar 2, 2015
    Posts:
    33
    Minecraft User:
    musaichi
    I trying communication to site<=>pmmp.
    but don't working this code.
    PHP:
    $postdata= array(
    "name"=>"musaichi"
    "ip"
    =>"111.222.333.444"
    );
    $curl=curl_init("http://example.com/");
    curl_setopt($curl,CURLOPT_POSTTRUE);
    curl_setopt($curlCURLOPT_POSTFIELDShttp_build_query($postdata));
    curl_setopt($curl,CURLOPT_RETURNTRANSFERTRUE);
    curl_setopt($curl,CURLOPT_SSL_VERIFYPEERFALSE);
    curl_setopt($curl,CURLOPT_SSL_VERIFYHOSTFALSE);
    curl_setopt($curl,CURLOPT_FOLLOWLOCATIONTRUE);
    $responsecurl_exec($curl);
    ↑This is PMMP using code.
    PHP:
    echo $_POST["name"];
    echo 
    $_POST["ip"];
    ↑This is Site code.
    But don't work it...Could you tell me How to correct it?
    Last edited: Feb 23, 2016
  2. Legoboy0215
    Offline

    Legoboy0215 Notable Member

    Joined:
    Nov 1, 2014
    Posts:
    1,724
    Minecraft User:
    Legoboy0215
    Use Utils::getURL() :)
  3. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Apart from missing a comma on line 2, it works for me.
    musaichi likes this.
  4. musaichi
    Offline

    musaichi New Member

    Joined:
    Mar 2, 2015
    Posts:
    33
    Minecraft User:
    musaichi
    I had overlooked miss code.thanks!
    thanks,But I think getURL() is only get the URL...
  5. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    applqpak likes this.
  6. musaichi
    Offline

    musaichi New Member

    Joined:
    Mar 2, 2015
    Posts:
    33
    Minecraft User:
    musaichi

Share This Page

Advertisement