Skip to content

Instantly share code, notes, and snippets.

@arduanov
Created December 23, 2014 15:42
Show Gist options
  • Save arduanov/f45b72f37377671659c6 to your computer and use it in GitHub Desktop.
Save arduanov/f45b72f37377671659c6 to your computer and use it in GitHub Desktop.
<?php
$url = "https://www.nic.ru/dns/dealer";
$user_agent = "Mozilla/5.0 (compatible; MSIE 5.01; Windows NT 5.0)";
$data = "lang:ru\r\n";
$data .= "login:1234/NIC-REG/ADM\r\n";
$data .= "password:password\r\n";
$data .= "request:account\r\n";
$data .= "operation:get\r\n";
$data .= "request-id:20120227180000.1234@nic.ru\r\n";
$post_str = "SimpleRequest=".rawurlencode($data);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_USERAGENT, $user_agent);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt ($ch, CURLOPT_POSTFIELDS, $params);
$result = curl_exec($ch);
curl_close($ch);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment