Jeg har skam tjekket for fejl, og det
Burde virke..
print $_GET['userid'] giver 1 hver gang..
Alle felterne findes i tabellen..
Skal bruge et hint...:
<?
$conn = mysql_connect("localhost", "USER", "PASSWORD") or die (mysql_error());
mysql_select_db("Database", $conn) or die (mysql_error());
$sql = "SELECT * FROM tagwall WHERE Id='". $_GET['userid'] ."' ORDER BY Dato DESC";
$result = mysql_query($sql, $conn) or die (mysql_error());
$xml = new SimpleXMLElement('<guestbook></guestbook>');
$posts = $xml->addChild('posts');
while($new == mysql_fetch_assoc($result)) {
$post = $posts->addChild('post');
$post->addChild('id',$new['Id']);
$post->addChild('nr',$new['Nr']);
$post->addChild('fraid',$new['Fra']);
$post->addChild('franick',$new['Fra_nick']);
$post->addChild('dato',$new['Dato']);
$post->addChild('text',$new['Text']);
}
// Headers til browseren
header('Pragma: public');
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Cache-Control: private',false);
header('Content-Type: application/force-download');
header('Content-Disposition: attachment; filename="guestbook.xml";');
// Indhold til filen
print $xml->asXML();
// Dø script!
die();
?>