Follow along with the video below to see how to install our site as a web app on your home screen.
Примечание: This feature may not be available in some browsers.
Обновил архив, проверь.если не ошибаюсь, походу хочет через composer /vendor/autoload.php , а там
xsist10\SafeBrowsing\Strategy\Strategy
как его подключить ?
<?php
/**
* Defining constants for the CGI parameters of the HTTP GET Request
* */
define ( 'API_KEY', "tut API_KEY" );
define ( 'PROTOCOL_VER', '3.0' );
define ( 'CLIENT', 'checkURLapp' );
define ( 'APP_VER', '1.0' );
/**
* Function for sending a HTTP GET Request
* to the Google Safe Browsing Lookup API
*/
function get_data($url) {
$ch = curl_init ();
curl_setopt ( $ch, CURLOPT_URL, $url );
curl_setopt ( $ch, CURLOPT_SSL_VERIFYPEER, false );
curl_setopt ( $ch, CURLOPT_SSL_VERIFYHOST, false );
curl_setopt ( $ch, CURLOPT_RETURNTRANSFER, true );
$data = curl_exec ( $ch );
$httpStatus = curl_getinfo ( $ch, CURLINFO_HTTP_CODE );
curl_close ( $ch );
return array (
'status' => $httpStatus,
'data' => $data
);
}
/**
* Function for analyzing and paring the
* data received from the Google Safe Browsing Lookup API
*/
function send_response($input) {
if (! empty ( $input )) {
$urlToCheck = urlencode ( $input );
$url = 'https://sb-ssl.google.com/safebrowsing/api/lookup?client=' . CLIENT . '&apikey=' . API_KEY . '&appver=' . APP_VER . '&pver=' . PROTOCOL_VER . '&url=' . $urlToCheck;
$response = get_data ( $url );
if ($response ['status'] == 204) {
return json_encode ( array (
'status' => 204,
'checkedUrl' => $urlToCheck,
'message' => 'The website is not blacklisted and looks safe to use.'
) );
} elseif ($response ['status'] == 200) {
return json_encode ( array (
'status' => 200,
'checkedUrl' => $urlToCheck,
'message' => 'The website is blacklisted as ' . $response ['data'] . '.'
) );
} else {
return json_encode ( array (
'status' => 501,
'checkedUrl' => $urlToCheck,
'message' => 'Something went wrong on the server. Please try again.'
) );
}
} else {
return json_encode ( array (
'status' => 401,
'checkedUrl' => '',
'message' => 'Please enter URL.'
) );
}
;
}
$checkMalware = send_response ( $_POST ['url'] );
$checkMalware = json_decode($checkMalware, true);
$malwareStatus = $checkMalware['status'];
echo $malwareStatus;
?>
Обновил архив, проверь.
Warning: curl_setopt(): CURLOPT_FOLLOWLOCATION cannot be activated when an open_basedir is set in /home/_____/public_html/pay/vendor/xsist10/safebrowser/src/Strategy/Post.php on line 40
Fatal error: Uncaught exception 'RuntimeException' with message 'Remote server returned an unexpected response: 403' in /home/_____/public_html/pay/vendor/xsist10/safebrowser/src/Strategy/Post.php:65 Stack trace: #0 /home/______/public_html/pay/vendor/xsist10/safebrowser/src/Strategy/Chain.php(22): xsist10\SafeBrowsing\Strategy\Post->execute('https://sb-ssl....', Array) #1 /home/_____/public_html/pay/vendor/xsist10/safebrowser/src/SafeBrowsing.php(33): xsist10\SafeBrowsing\Strategy\Chain->execute('https://sb-ssl....', Array) #2 /home/u_____/public_html/pay/sb.php(14): xsist10\SafeBrowsing\SafeBrowsing->isUrlSafe('http://ianfette...') #3 {main} thrown in /home/_____/public_html/pay/vendor/xsist10/safebrowser/src/Strategy/Post.php on line 65
Вот что то, только не пойму как вставить ссылку,которую нужно проверить,помоги
<form method="post" action="index1.php">
<label>Enter URL for checking:</label>
<input type="text" name="url" class="url" id="url">
<input type="submit" name="check" class="checkSubmit" value="Check Now!">
</form>