Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [XML][PHP]XML w PHP lub PHP w XML
h4lski2
post
Post #1





Grupa: Zarejestrowani
Postów: 5
Pomógł: 0
Dołączył: 5.02.2012

Ostrzeżenie: (10%)
X----


Witam,
Mam problem i szukam pomocy.

Problem dotyczy pliku data.xml
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <coverflow
  3. imageWidth="151"
  4. imageHeight="151"
  5. imagePadding="1"
  6. coverflowSpacing="40"
  7. startIndex="0"
  8. startIndexInCenter="yes"
  9. coverLabelPositionY="240"
  10. coverSlidePositionY="270"
  11. transitionTime="0.5"
  12. centerCoverflowZPosition="80"
  13. target="_blank"
  14. reflectionAlpha="35"
  15. reflectionRatio="50"
  16. reflectionDistance="0"
  17. reflectionUpdateTime="-1"
  18. reflectionDropoff="0.75"
  19. >
  20. <cover
  21. img="images/album1.jpg"
  22. title="The Doors"
  23. link="http://www.jakasstrona.pl" />
  24. </coverflow>


Chce zrobić by w tym pliku znalazł się kod PHP.

  1. <?PHP
  2. $zapytanie = mysql_query("SELECT * FROM video WHERE czeka='0' AND typ='kabaret' ORDER BY RAND() LIMIT 8");
  3.  
  4. if ($zapytanie) {
  5. while ($shit = mysql_fetch_array($zapytanie)){
  6. <cover
  7. img="'.$shit['zdjecie'].'"
  8. title="'.$shit['tytul'].'"
  9. link="'.$shit['link'].'" />';
  10. }
  11. }
  12. ?>


Poprostu chce osiągnać efekt by w pliku xml generowaly sie wpisy <cover> automatycznie, pobierajac z bazy.

Ten post edytował h4lski2 5.02.2012, 23:44:47
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
h4lski2
post
Post #2





Grupa: Zarejestrowani
Postów: 5
Pomógł: 0
Dołączył: 5.02.2012

Ostrzeżenie: (10%)
X----


Dodałem header.
  1. <?php
  2.  
  3. header('Content-type: application/xml; charset="utf-8"');
  4.  
  5. ?><?xml version="1.0" encoding="utf-8"?>
  6.  
  7. <data>
  8. <dzien>13</dzien>
  9. <miesiac>maj</miesiac>
  10. <rok>2004</rok>
  11. </data>
  12. <coverflow
  13. imageWidth="151"
  14. imageHeight="151"
  15. imagePadding="1"
  16. coverflowSpacing="40"
  17. startIndex="0"
  18. startIndexInCenter="yes"
  19. coverLabelPositionY="240"
  20. coverSlidePositionY="270"
  21. transitionTime="0.5"
  22. centerCoverflowZPosition="80"
  23. target="_blank"
  24. reflectionAlpha="35"
  25. reflectionRatio="50"
  26. reflectionDistance="0"
  27. reflectionUpdateTime="-1"
  28. reflectionDropoff="0.75"
  29. >
  30. <cover
  31. img="images/album1.jpg"
  32. title="The Doors"
  33. link="http://www.ilike.com/artist/The+Doors?src=onebox" />
  34. </coverflow>

Dwa błędy. W obu ta sama treść.

http://www.pakiecik.pl/xml/data.php

http://www.pakiecik.pl/xml/data.xml
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: 10.10.2025 - 16:32