Skip to content

Instantly share code, notes, and snippets.

@clcneogeek325
Created May 10, 2018 15:27
Show Gist options
  • Select an option

  • Save clcneogeek325/6500f48fdb506771009bd397e906c7e8 to your computer and use it in GitHub Desktop.

Select an option

Save clcneogeek325/6500f48fdb506771009bd397e906c7e8 to your computer and use it in GitHub Desktop.

Revisions

  1. NEO created this gist May 10, 2018.
    23 changes: 23 additions & 0 deletions php_curl_post.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,23 @@
    <?php
    $post = array(
    # Data Credentials
    "user"=> "demo",
    "passw"=> "demo",

    );
    $data = http_build_query($post);

    $curl = curl_init();

    curl_setopt($curl, CURLOPT_URL, "http://google.com");
    curl_setopt($curl, CURLOPT_POST, true);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);

    $response = curl_exec($curl);

    curl_close($curl);

    //file_put_contents($post["vucemCove"].".xml", $response);

    echo "Resultado del CURL ".$response;