hoi iedereen,

ik ben bezig om een nieuwsbrief automatischs eens per week te versturen,

dit wil ik doen met mailchip. nu heb ik een rss feed geschreven in mijn php maar mailchimp zegt dat het geen geldige rss fe3ed is

hieronder mijn rss script en ik weet 100% zeker dat deze de juiste inhoud heeft alleen weet ik niet of mijn rss voldoet aan de eisen

graag een duwtjhe in de richting waar ik zal moeten kijken

Bvd
Ralph
<?
include_once('../inc/config.php');
include_once('../classes/MCAPI.class.php');

// create campaign

// defineer variabelen.
$cList = $_POST['cList'];
$cName = $_POST['cName'];
$cType = $_POST['cType'];
$cSubject = $_POST['cSubject'];
$cSender = $_POST['cSender'];
$cReply = $_POST['cReply'];

// get content
$cRawContent = file_get_contents($cUrl);
$cRawContent = str_replace("€", "€", $cRawContent);

preg_match_all($cFullPage, $cRawContent, $match);

// verwerk de content


$cProducts = array();
foreach($match[1] as $key => $cValue){

$product = array();
$cProductUrl = array();
// titel
preg_match_all($cNameRegExp, $cValue, $cName);

// images url
preg_match_all($cImageRegExp, $cValue, $cImageSrc);
// product url
preg_match_all ($cProductRegExp, $cValue, $cProductUrl);
//van prijs.
preg_match_all($cVanPrijsRegExp, $cValue, $cVanPrijs);
//voor prijs
preg_match_all($cVoorPrijsRegExp, $cValue, $cVoorPrijs);
// prijs exclusief btw werkt niet.
//preg_match_all($cExcBtwRegExp, $cValue, $cExcBtw);

$product['name'] = trim($cName[1][1]);
$product['img'] = trim($cImageSrc[1][0]);
$product['url'] = trim($cProductUrl[1][0]);
$product['vanPrijs'] = (double) trim($cVanPrijs[1][0]);
$product['voorPrijs'] = (double) trim($cVoorPrijs[1][0]);
//$product['prijsExcBtw']= (double) trim($cExcBtw[1][0]);

$cProducts[] = $product;
}
header("Content-Type: application/xml; charset=UTF-8");
$cProductsXml="<rss version=\"2.0\"><products>
<title>Herman Buitelaar</title>
<link>http://www.hermanbuitelaar.nl</link>;
<description>Herman's acties!</description>
<pubDate>Tue, 16 Sep 2010 15:55:58 +0000</pubDate>";

foreach($cProducts as $key => $value){
$cProductsXml .='
<product>
<name>'.$value['name'].'</name>
<images>'.$value['img'].'</images>
<url>'.$value['url'].'</url>
<vanPrijs>'.$value['vanPrijs'].'</vanPrijs>
<voorPrijs>'.$value['voorPrijs'].'</voorPrijs>
</product>
';
}
$cProductsXml .='</products></rss>';

echo $cProductsXml;
?>
Er ontbreekt een hoofding.
Analoog aan het <!doctype>

Voeg dit lijntje (of iets in die aard) toe als eerste lijn output.

<?xml version="1.0" encoding="ISO-8859-1" ?>

Hier zie je een voorbeeld
http://www.w3schools.com/rss/rss_syntax.asp
maakt voor de xml validator geen verschil

[size=xsmall]Toevoeging op 05/09/2013 15:37:15:[/size]



Warning No DOCTYPE found! Checking XML syntax only.

The DOCTYPE Declaration was not recognized or is missing. This probably means that the Formal Public Identifier contains a spelling error, or that the Declaration is not using correct syntax, or that your XML document is not using a DOCTYPE Declaration.

Validation of the document has been skipped, and a simple check of the well-formedness of the XML syntax has been performed instead.

Learn how to add a doctype to your document from our FAQ, or use the validator's option to validate your XML document against a specific Document Type

Info No Character encoding declared at document level




krijg ik terug van mijn rss validator


[size=xsmall]Toevoeging op 05/09/2013 15:37:54:[/size]

maar wat moet ik waar dan zetten want als ik de opmerking van kris er voor zet blijf ik dit ook krijgen

[size=xsmall]Toevoeging op 06/09/2013 10:06:32:[/size]

ok rss werkt nu maar nu werkt maar hij laat aleen titel en description zien

Reageren