There is a simple page with a table.

<table border="1" cellspacing="0" bordercolor="#C0C0C0" cellpadding="0" width="100%"><tbody> <tr> <td bgcolor="#c0c0c0"><p align="center"><strong>№ Карты</strong></p></td> <td bgcolor="#c0c0c0"><p align="center"><strong>Пользователь</strong></p> </td> <td bgcolor="#c0c0c0"><p align="center"><strong>Баланс</strong></p></td> </p></td> </tr><tr> <td bgcolor="#ffffff">001641</td> <td>Иванов Иван Иванович</td> <td><p align="right">100,00</p></td> </tr><tr> <td bgcolor="#ffffff">001679</td> <td>Антонов Артём Анатольевич</td> <td><p align="right">200,00</p></td> </tr><tr> </tr></tbody></table> 

required by php copy this table to your page.

There is one more nuance, access to the source table is carried out through HTTP Basis authentication.

please help

    2 answers 2

     $username = "user"; $password = "pass"; $host_api = "http://site.ru"; $param = 1; // авторизация $curl = curl_init($host_api); curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC); curl_setopt($curl, CURLOPT_USERPWD, $username . ":" . $password); // get запрос curl_setopt($curl, CURLOPT_URL, "$host_api/script.php?param=$param"); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); $result = curl_exec($curl); print $result; 

      If the user is on a foreign site, then do everything through the get_file_contents function (here’s an article on the Habré https://habrahabr.ru/sandbox/72702/ ) about authentication, I don’t know, but the php documentation has a section called "basic http authentication" search there