Ciao a tutti ....
Scusate il titolo non troppo preciso, ma non sapevo bene come titolare questo 3d.
Premesso che testo i file su server linux con apache 2 php 4.3.5 con le librerie dom abilitate (expat version 1.95.6).
Detto questo ho un file php che legge da db dei dati e genera un file xml.
Il problema e' che la pagina errori non ne da.
A video i browser danno uno strano output sia mozzila firefox (latest version) sia internet explorer 6.1.
Se pero' faccio visualizza -> html , il documento c'e' bello corretto, faccio copia e incolla, in un nuovo documento xml e lo visualizzo correttamente dal browser.
Se leggo a runtime il documento generato da php per esempio da flash tutto funziona bene .....
Non capisco proprio il problema dove potrebbe stare.
Codice completo della pagina php
strano output via browsercodice:<?php error_reporting(E_ALL); require("conf.inc.php"); /* session_name('SID'); session_start(); if ((!isset($_SESSION['usr'])) || (!isset($_SESSION['psw']))) { header ('location:admin.php'); }else{ header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); header("Cache-Control: no-store, no-cache, must-revalidate"); header("Pragma: no-cache"); */ ob_start(); $sql='SELECT DISTINCT modello,img_mini,img_grande FROM articoli ORDER BY modello ASC'; $query=mysql_query($sql,$connessione); $xml = domxml_new_doc("1.0"); $root = $xml -> create_element("str"); $mini_path="http://www.visconf.net/upload/mini/"; $grandi_path="http://www.visconf.net/upload/grandi/"; while ($row=mysql_fetch_array($query)) { $modello = $xml -> create_element("modello"); $root -> append_child($modello); $mod = $row['modello']; $img_mini=$mini_path.$mod.'.jpg'; $img_grande=$grandi_path.$mod.'.jpg'; $modtext = $xml -> create_text_node ($mod); $modello -> append_child ($modtext); $mini = $xml -> create_element("mini"); $grande = $xml -> create_element("grande"); $link = $xml -> create_element ("the_link"); $modello -> append_child ($mini); $modello -> append_child ($grande); $modello -> append_child ($link); if ($row['img_mini'] == 'Immagine non presente') { $testo__mini = $xml -> create_text_node("Immagine non presente"); $testo__grande = $xml -> create_text_node("Immagine non presente"); $mini -> append_child ($testo__mini); $grande -> append_child ($testo__grande); $linkvar = 'Inserisci/Modifica'; $testo_link = $xml ->create_cdata_section ($linkvar); $link -> append_child ($testo_link); }else{ $minivar = 'Visualizza'; $grandevar = 'Visualizza'; $testo_mini = $xml ->create_cdata_section ($minivar); $testo_grande = $xml ->create_cdata_section ($grandevar); $mini -> append_child ($testo_mini); $grande -> append_child ($testo_grande); $linkvar = 'Inserisci/Modifica'; $testo_link = $xml ->create_cdata_section ($linkvar); $link -> append_child ($testo_link); } } $xml -> append_child ($root); echo utf8_encode($xml -> dump_mem(true,"UTF-8")); mysql_close($connessione); header ("Content-Length: ".ob_get_length()); ob_end_flush(); //}//end sess ?>
Link
Ogni commento suggerimento è gradito.


Rispondi quotando