Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_HTTPHEADER, ["Content-Type: application/x-www-form-urlencoded;charset=utf-8"]);
- curl_setopt($ch, CURLOPT_URL, static::ENDPOINT . \Util\SystemConfig::getInstance()->CalltouchSiteID() . "/register/");
- curl_setopt($ch, CURLOPT_POST, 1);
- curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query([
- "fio" => urlencode($this->_name),
- "phoneNumber" => $this->_phone,
- "email" => $this->_email,
- "subject" => urlencode($this->_title),
- "sessionId" => $this->_visitCookie ?? "nocookie",
- "comment" => implode("; ", $this->_comment) ?: "Отсутствует",
- ])
- );
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
- $response = @curl_exec($ch);
- $info = @curl_getinfo($ch);
- curl_close($ch);
- return [
- "curl_getinfo" => $info,
- "curl_exec" => json_decode($response, true),
- "url" => static::ENDPOINT . \Util\SystemConfig::getInstance()->CalltouchSiteID() . "/register/",
- "request" => http_build_query([
- "fio" => urlencode($this->_name),
- "phoneNumber" => $this->_phone,
- "email" => $this->_email,
- "subject" => urlencode($this->_title),
- "sessionId" => $this->_visitCookie ?? "nocookie",
- "comment" => implode("; ", $this->_comment) ?: "Отсутствует",
- ]),
- ];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement