Advertisement
DarkVss

Untitled

Mar 21st, 2025
361
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.60 KB | None | 0 0
  1.         $ch = curl_init();
  2.         curl_setopt($ch, CURLOPT_HTTPHEADER, ["Content-Type: application/x-www-form-urlencoded;charset=utf-8"]);
  3.         curl_setopt($ch, CURLOPT_URL, static::ENDPOINT . \Util\SystemConfig::getInstance()->CalltouchSiteID() . "/register/");
  4.         curl_setopt($ch, CURLOPT_POST, 1);
  5.         curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query([
  6.                 "fio"         => urlencode($this->_name),
  7.                 "phoneNumber" => $this->_phone,
  8.                 "email"       => $this->_email,
  9.                 "subject"     => urlencode($this->_title),
  10.                 "sessionId"   => $this->_visitCookie ?? "nocookie",
  11.                 "comment"     => implode("; ", $this->_comment) ?: "Отсутствует",
  12.             ])
  13.         );
  14.         curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  15.         $response = @curl_exec($ch);
  16.         $info = @curl_getinfo($ch);
  17.         curl_close($ch);
  18.  
  19.         return [
  20.             "curl_getinfo" => $info,
  21.             "curl_exec"    => json_decode($response, true),
  22.             "url"          => static::ENDPOINT . \Util\SystemConfig::getInstance()->CalltouchSiteID() . "/register/",
  23.             "request"      => http_build_query([
  24.                 "fio"         => urlencode($this->_name),
  25.                 "phoneNumber" => $this->_phone,
  26.                 "email"       => $this->_email,
  27.                 "subject"     => urlencode($this->_title),
  28.                 "sessionId"   => $this->_visitCookie ?? "nocookie",
  29.                 "comment"     => implode("; ", $this->_comment) ?: "Отсутствует",
  30.             ]),
  31.         ];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement