Child pages
  • Звонок с сайта
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

 Форма на сайт

<form method="post" action="/web_to_call.php">

  Введите Ваш телефон

  <input value="" name="client_number" type="text">

  <input value="Отправить заявку" type="submit">

</form>     

 Скрипт php

 

<?php
$url='http://my.td.ru/abonent_dev.php/web_to_call/siteListener';
$params = array();
$params['client_number'] = $_REQUEST['client_number'];
$params['call_start_datetime'] = date('Y-m-d H:i:s');
$params['form_id'] = '190774';
      
$ch = curl_init();
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_VERBOSE, false);
curl_setopt($ch, CURLOPT_URL,$url);

curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_TIMEOUT, 50);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);

$result = curl_exec($ch);
curl_close($ch);

header('Location: '.$_SERVER['HTTP_REFERER']);
?>

  • No labels