You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I have a problem generating a dynamic url sitemap. My URL is https://apartamente-24.ro/#!/posts/Apartament-5-camere-Cars-Brasov/19. Where: Apartment-5-rooms-Center-Brasov is the title saved in the database. And 19 is id. Unfortunately, now I only export my id or title not both.
`<?php
// CONFIGURATION
// Set a password to limit access to generating XML's
$token = "aaa";
// Set your MySQL details
$servername="aaa";
$username="aaa";
$password="aaa";
$dbname="aaa";
// Set your custom table name to generate
$table_name = "Posts";
// Set your custom column name to generate
$column_name = "title, id";
// Your site Base URL
$base_url = "https://apartamente-24.ro/sfaturi-din-imobiliare/#!/posts/";
$frequency = "daily";
// These are the static/page/subdirectories you need to include in the site map
$static_pages = array("","index.html");
Hello, I have a problem generating a dynamic url sitemap. My URL is https://apartamente-24.ro/#!/posts/Apartament-5-camere-Cars-Brasov/19. Where: Apartment-5-rooms-Center-Brasov is the title saved in the database. And 19 is id. Unfortunately, now I only export my id or title not both.
connect_error) { die("Connection failed: " . $conn->connect_error); } $query = "SELECT $column_name FROM $table_name"; $result = mysqli_query($conn, $query); $dom = new DomDocument('1.0', 'UTF-8'); $root = $dom->appendChild($dom->createElement('urlset')); $attr = $dom->createAttribute('xmlns'); $attr->appendChild($dom->createTextNode('http://www.sitemaps.org/schemas/sitemap/0.9')); $root->appendChild($attr); $count = 0; foreach ($static_pages as $page ) { generate_elements($page); } while ($row = mysqli_fetch_assoc( $result) ) { $curr = $row[$column_name]; generate_elements($curr); } echo "In sitemap au fost generate : $count
"; $dom->formatOutput = true; $test1 = $dom->saveXML(); $dom->save('sitemap_forum.xml'); function generate_elements($curr){ global $base_url,$frequency,$root,$dom,$count; $url = $dom->createElement('url'); $root->appendChild($url); $loc = $dom->createElement('loc',$base_url.$curr); $url->appendChild($loc); $lastmod = $dom->createElement('lastmod',date("Y-m-d")); $url->appendChild($lastmod); $changefreq = $dom->createElement('changefreq',$frequency); $url->appendChild($changefreq); $priority = $dom->createElement('priority',1); $url->appendChild($priority); $count++; } ?>The text was updated successfully, but these errors were encountered: