<?php
get_header();
?>
<form action="" method="post">
First Name: <input type="text" name="FirstName" /><br />
Last Name: <input type="text" name="LastName" /><br />
<br />
<input type="submit" name="Send" value = "Send">
</form>
<?php
require 'vendor/autoload.php';
$client = new \Google_Client();
$client->setApplicationName("Google Sheets");
$client->setScopes([\Google_Service_Sheets::SPREADSHEETS]);
$client->setAccessType('offline');
$client->setAuthConfig('vendor/key.json');
$service = new Google_Service_Sheets($client);
$spreadsheetId = "1LlrsWpwBpqBowqgvbNFr7wwZfwGtzqAldQrW668k9bY";
$range = "list!A1:N10000";
$response = $service->spreadsheets_values->get($spreadsheetId,$range);
$values = $response->getValues();
foreach($values as $row){
$i++;
if ($row[2] == $_POST['FirstName'] && $row[3] == $_POST['LastName']){
$result = "Date: ".$row[0]."<br>\nDomain: ".$row[1]."<br>\nFirst Name: ".$row[2]."<br>\nLast Name: ".$row[3]."<br>\nDate of birth: ".$row[4].
"<br>\nAddress: ".$row[5]."<br>\nApt./Suite: ".$row[6]."<br>\nCity: ".$row[7]. "<br>\nZIP: ".$row[8]."<br>\nEmail: ".$row[9]."<br>\nPhone number: ".$row[10].
"<br>\nSymptoms or conditions: ".$row[11]."<br>\nOther information: ".$row[12]."<br>\nLink on photo: ".$row[13];
echo $result;
}
else $result++;
}
if ($i == $result)
{
header('Location: https://www.google.com/');
}
get_sidebar();
get_footer();
?>
Выводит при сохранении файла
Подскажите, в чем проблема?