| Server IP : 217.160.0.50 / Your IP : 216.73.216.185 Web Server : Apache System : Linux info 3.0 #1337 SMP Tue Jan 01 00:00:00 CEST 2000 all GNU/Linux User : u106894358 ( 5897830) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /homepages/43/d895481126/htdocs/clickandbuilds/LogestyServices/ |
Upload File : |
<?php
function submitSitemapToGoogle($sitemap_url)
{
// This is a simplified example. In a real-world scenario, you'd use Google Search Console API.
// Direct "ping" URLs are largely deprecated by Google.
// You would typically submit your sitemap within Google Search Console.
// For demonstration, a basic cURL request (not a true "ping" for indexing):
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://www.google.com/ping?sitemap=" . urlencode($sitemap_url));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
return $response;
}
// Example usage:
$your_sitemap_url = "https://logesty-services.fr/sitemap.xml";
$result = submitSitemapToGoogle($your_sitemap_url);
if ($result) {
echo "Attempted to notify Google about sitemap: " . $your_sitemap_url;
} else {
echo "Failed to notify Google.";
}
?>