function get_web_page($url)
$uagent = "Opera/9.80 (Windows NT 6.1; WOW64) Presto/2.12.388 Version/12.14";
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // recovers the web page
curl_setopt($ch, CURLOPT_HEADER, 0); // doesn’t recover headers
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); // follows redirects
curl_setopt($ch, CURLOPT_ENCODING, ""); // handles all encodings
curl_setopt($ch, CURLOPT_USERAGENT, $uagent); // useragent
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 20); // time-out of the connection
curl_setopt($ch, CURLOPT_TIMEOUT, 20); // time-out of the answer
curl_setopt($ch, CURLOPT_MAXREDIRS, 2); // stops after the 10th redirect
$content = curl_exec($ch);
$errmsg = curl_error($ch);
$header = curl_getinfo($ch);
$header['errmsg'] = $errmsg;
$header['content'] = $content;
You can test it through the console, for example: curl http://localhost:8888/history
The example of the Cron-task handler script for receiving new transactions and the table structure
CREATE TABLE `pzm_history` (
`id` bigint(20) NOT NULL,
`tarif_id` int(1) NOT NULL,
`tr_id` varchar(255) NOT NULL,
`tr_date` varchar(255) NOT NULL,
`tr_timestamp` int(11) NOT NULL,
`pzm` varchar(50) NOT NULL,
`summa` decimal(16,2) NOT NULL,
`mess` varchar(255) NOT NULL,
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
** All necessary keys and autoincrement for ID should be added to the table