function connect($link) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$link);
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (iPad; CPU OS 9_1 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Version/9.0 Mobile/13B143 Safari/601.1");
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION,1);
curl_setopt($ch, CURLOPT_TIMEOUT, 0);
curl_setopt($ch, CURLOPT_HEADER, 0);
$response = curl_exec($ch);
curl_close($ch);
return $response;
}
file_put_contents('test.csv', connect("http://your_link.here/script?token=qweqwe"));
if(isset($_POST['name']))
{
$name = mysql_real_escape_string($_POST['name']);
$surname = mysql_real_escape_string($_POST['surname']);
$SQL = "SELECT * FROM Users WHERE name='$name' AND surname='$surname' LIMIT 1";
$result = mysqli_query($link, $SQL);
$users = mysqli_fetch_all($result, MYSQLI_ASSOC);
if ($result) {
?>
<tr>
<td><?=$users['surname']?> <?=$users['name']?></td>
<td><?=$users['birth_date']?></td>
<td><?=$users['birth_place']?></td>
<td><?=$users['citizenship']?></td>
<td><?=$users['term']?></td>
</tr>
<?php
}
else {
printf("Ошибка: %s\n", mysqli_error($link));
}
}