Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [XML][PHP]Tworzenie struktury xml
patpop
post
Post #1





Grupa: Zarejestrowani
Postów: 9
Pomógł: 0
Dołączył: 4.11.2011

Ostrzeżenie: (0%)
-----


Witam. W pliku php tworzę prostą strukturę xml w następujący sposób:

  1. <?php
  2.  
  3. $firstNumber = $_GET['firstNumber'];
  4.  
  5. $result = $firstNumber;
  6. $flaga = 1;
  7.  
  8. //tworze dokument xml
  9. $response = '<?xml version="1.0" encoding="utf-8" standalone="yes"?>' .
  10. '<response>' . '<result>' . $firstNumber . '</result>' . '<flaga>' . $flaga . '</flaga>' .
  11. '</response>';
  12.  
  13. header('Content-Type: text/xml');
  14. echo $response;
  15.  
  16. ?>


Wszystko działa poprawnie. Jednak gdy dodam do pliku "require_once(...)" wyświetla mi błąd struktury xml :

  1. <?php
  2. require_once('funkcje_bazy_danych.php');
  3.  
  4. $firstNumber = $_GET['firstNumber'];
  5.  
  6. $result = $firstNumber;
  7. $flaga = 1;
  8.  
  9. //tworze dokument xml
  10. $response = '<?xml version="1.0" encoding="utf-8" standalone="yes"?>' .
  11. '<response>' . '<result>' . $firstNumber . '</result>' . '<flaga>' . $flaga . '</flaga>' .
  12. '</response>';
  13.  
  14. header('Content-Type: text/xml');
  15. echo $response;
  16.  
  17. ?>


Nie mam pojęcia jak to ugryźć... Może macie jakieś pomysły (IMG:style_emoticons/default/smile.gif)
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 23.08.2025 - 01:48