formatOutput = true;
$urlset = $doc->createElement('urlset');javascript:;
$urlset->setAttribute('xmlns', 'http://www.sitemaps.org/schemas/sitemap/0.9');
$doc->appendChild($urlset);
foreach ($keywords as $keyword) {
$url = $config['url'] . '?' . $config['parameter'] . '=' . urlencode(trim($keyword));
$urlElement = $doc->createElement('url');
$locElement = $doc->createElement('loc', htmlspecialchars($url));
$urlElement->appendChild($locElement);
$lastmodElement = $doc->createElement('lastmod', date("Y-m-d"));
$urlElement->appendChild($lastmodElement);
$changefreqElement = $doc->createElement('changefreq', 'daily');
$urlElement->appendChild($changefreqElement);
$urlset->appendChild($urlElement);
}
$doc->save($config['sitemap']);
}
if(isset($_GET[$config['parameter']]) && !empty($_GET[$config['parameter']])) {
foreach($keywords as $keyword) {
if(strtolower(trim($_GET[$config['parameter']])) == strtolower(trim($keyword))) {
$brand = trim($keyword);
$url = $config['url'] . '?' . $config['parameter'] . '=' . urlencode($brand);
$amp = $config['amp'] . '?' . $config['tes'] . '=' . urlencode($brand);
$html = str_replace('{{ BRAND }}', $brand, $html);
$html = str_replace('{{ URL }}', $url, $html);
$html = str_replace('{{ AMP }}', $amp, $html);
echo $html;
exit;
}
}
}
header("HTTP/1.1 404 Not Found");
exit;