Search
 
SCRIPT & CODE EXAMPLE
 

PHP

sitemap for php website

<?php 
header("Content-type: text/xml");
echo '<?xml version="1.0" encoding="UTF-8" ?>';
include 'includes/connectdb.php';
?>

<urlset xmlns="http://www.google.com/schemas/sitemap/0.84" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.google.com/schemas/sitemap/0.84 http://www.google.com/schemas/sitemap/0.84/sitemap.xsd">

    <url>
        <loc>http://www.DOMAIN.co.uk/</loc>
        <priority>1.00</priority>
    </url>

    <?php

    $sql = "SELECT * FROM pages WHERE onshow = 1 ORDER BY id ASC";
    $result = mysql_query($sql,$conn);      
    while($row = mysql_fetch_array($result))
    { 
    $filename = stripslashes($row['filename']);
    ?>
    <url>
        <loc>http://www.<?php echo "$domain"; ?>/<?php echo "$filename" ?></loc>
        <changefreq>monthly</changefreq>
        <priority>0.5</priority>
    </url>

 <?php } ?>

</urlset>
Comment

PREVIOUS NEXT
Code Example
Php :: laravel 8 eloquent orderby 
Php :: how to check confirm password in php 
Php :: enum artisan codwe 
Php :: convert php to python online 
Php :: Reset Admin password in Magento 2 
Php :: array filter multiple conditions php 
Php :: laravel web php request to redirect to another page 
Php :: laravel csrf error 419 
Php :: laravel check if string is url 
Php :: how to make zip in php by multiple files 
Php :: php trim quotes 
Php :: can I change my ip adress with python 
Php :: woocommerce change add to cart message 
Php :: show featured image in post wordpress 
Php :: string match in php 
Php :: change the date format in laravel view page 
Php :: laravel add column to table 
Php :: php artisan create controller inside folder 
Php :: laravel cannot add foreign key constraint 
Php :: How to disable Gutenberg / block editor for certain post types 
Php :: php is_int 
Php :: laravel Class "PDO" not found 
Php :: laravel blade @selected 
Php :: loop iteration laravel 
Php :: laravel groupby and latest 
Php :: phpmyadmin add foreign key 
Php :: php connect strings 
Php :: french special characters php 
Php :: php numbers 
Php :: php get object josn 
ADD CONTENT
Topic
Content
Source link
Name
5+3 =