1. #1
    Avalanched's Avatar
    Registered
    21/09/02
    Location
    Beveren-waas
    Posts
    125
    iTrader
    0
    Mentioned
    0 Post(s)
    Reputation
    0/0

    PHP: XML parser :/

    dit php scriptje zou een XML pagina moeten maken
    maar het enige wat hij displayed zijn de variabelen uit de database hoe display ik ook de tags?

    PHP Code:
    <?php
        
    echo "<gb>";
        
    /* mysql */

        
    mysql_connect    (***********);   
        
    mysql_select_db  (***********);
        
    $sql "SELECT * FROM GB ORDER BY id DESC LIMIT 50";
        
    $query mysql_query($sql) or die(mysql_error());

        
    /* display XML */

        
    $i 0;
                   while (
    $obj mysql_fetch_object($query)) {
                        
    $i++;
                        
    $content htmlspecialchars($obj->content);
                        
    $content nl2br($content);
                        
    $date $obj->datum;
                echo 
    "<post$i>";
                echo 
    "<date>$date</date>";
                echo 
    "<content>$content</content>";
                echo 
    "</post$i>";
                echo 
    "</gb>";
                }
    ?>
    // Ava- `Off
    no votes  

  2. #2
    Col.Kurtz's Avatar
    Registered
    24/06/04
    Posts
    541
    iTrader
    2 (100%)
    Mentioned
    0 Post(s)
    Reputation
    0/0
    bovenaan je pagina :

    header("Content-Type: text/xml");
    no votes  

  3. #3
    Avalanched's Avatar
    Registered
    21/09/02
    Location
    Beveren-waas
    Posts
    125
    iTrader
    0
    Mentioned
    0 Post(s)
    Reputation
    0/0
    merci
    // Ava- `Off
    no votes  

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Log in

Log in