النتائج 1 إلى 2 من 2

الموضوع: هل يمكن دمج ال XML مع ال PHP باستخدام <?php ?>

  1. #1
    عضو جديد
    تاريخ التسجيل
    Apr 2010
    المشاركات
    16

    هل يمكن دمج ال XML مع ال PHP باستخدام <?php ?>



    السلام عليكم
    انا الان ابرمج سكريبت
    ولكن سؤال
    عندي ملف
    XML
    يوجد فيه مشغل القران
    مكان السورة عايز اجيبها من القاعدة
    عن طريق ال FORM ادخلتها
    كيف اجيبها في XML

    انا لدي مشغل بلير هذا كود علشان ادخل الصوتيات

    كود:
    <?xml version="1.0" encoding="UTF-8"?>
    <playlist version="1" xmlns="http://xspf.org/ns/0/">
        <title>Ounage Playlist</title>
        <creator>Dew</creator>
        <link>http://www.blup.fr/</link>
        <info>The Best Playlist for Testing</info>
        <image>covers/tracklist.jpg</image>
    
        <trackList>
    
            <track>
              <location>http://s2.musulmanin.com/radioislam.ru/audio/quran_baqara_last2.mp3</location>
              <creator>Bedrich Smetana</creator>
              <album>M&#225; Vlast</album>
              <title>La Moldau (Smetana)</title>
              <annotation>I love this song</annotation>
              <duration>32000</duration>
              <image>covers/smetana.jpg</image>
              <info></info>
              <link>http://s2.musulmanin.com/radioislam.ru/audio/quran_baqara_last2.mp3</link>
            </track>
    
            <track>
              <location></location>
              <creator>Cesaria Evora</creator>
              <album>Voz d'Amor (Cesaria Evora)</album>
              <title>Saia Travada</title>
              <annotation></annotation>
              <duration></duration>
              <image>covers/cesaria.jpg</image>
              <info></info>
              <link>http://fr.wikipedia.org/wiki/Cesaria_Evora</link>
            </track>
            
            <track>
              <location>mp3/katusha.mp3</location>
              <creator>Russian Red Army Choir</creator>
              <album>Best Of</album>
              <title>Katusha</title>
              <annotation></annotation>
              <duration></duration>
              <image>covers/redarmy.jpg</image>
              <info></info>
              <link>http://www.blup.fr/</link>
            </track>
            
            <track>
              <location>mp3/everywhere.mp3</location>
              <creator>Michelle Branch</creator>
              <album>Everywhere</album>
              <title>Everywhere (Michelle Branch)</title>
              <annotation></annotation>
              <duration></duration>
              <image>covers/everywhere.jpg</image>
              <link>http://fr.wikipedia.org/wiki/Michelle_Branch</link>
            </track>
            
            <track>
              <location>mp3/cartographer-caarano.mp3</location>
              <creator>E.S. Posthumus</creator>
              <album>Cartographer</album>
              <title>Caarano</title>
              <annotation></annotation>
              <duration></duration>
              <image>covers/cartographer.jpg</image>
              <info></info>
              <link>http://www.esposthumus.com/</link>
            </track>
            
            <track>
              <location>mp3/cartographer-isunova.mp3</location>
              <creator>E.S. Posthumus</creator>
              <album>Cartographer</album>
              <title>Isunova</title>
              <annotation></annotation>
              <duration></duration>
              <image>covers/cartographer.jpg</image>
              <info></info>
              <link>http://www.esposthumus.com/</link>
            </track>
            
            <track>
              <location>mp3/cartographer-nolitus.mp3</location>
              <creator>E.S. Posthumus</creator>
              <album>Cartographer</album>
              <title>Nolitus</title>
              <annotation></annotation>
              <duration></duration>
              <image>covers/cartographer.jpg</image>
              <info></info>
              <link>http://www.esposthumus.com/</link>
            </track>
    
            <track>
              <location>mp3/unearthed-nara.mp3</location>
              <creator>E.S. Posthumus</creator>
              <album>Unearthed</album>
              <title>Nara</title>
              <annotation></annotation>
              <duration></duration>
              <image>covers/unearthed.jpg</image>
              <info></info>
              <link>http://www.esposthumus.com/</link>
            </track>
    
            <track>
              <location>mp3/cortex.mp3</location>
              <creator>Warner Bros</creator>
              <album>Conquérir le Monde</album>
              <title>Minus et Cortex</title>
              <annotation></annotation>
              <duration></duration>
              <image>covers/minus.jpg</image>
              <info></info>
            </track>
    
            <track>
              <location>mp3/hussard.mp3</location>
              <creator>Jean-Claude Petit</creator>
              <album>Le Hussard sur le Toit</album>
              <title>Le Hussard sur le Toit</title>
              <annotation></annotation>
              <duration></duration>
              <image>covers/hussard.jpg</image>
              <info></info>
            </track>
    
            <track>
              <location>mp3/vinci.mp3</location>
              <creator>Dan Brown</creator>
              <album>Da Vinci Code</album>
              <title>Da Vinci Code</title>
              <annotation></annotation>
              <duration></duration>
              <image>covers/vinci.jpg</image>
              <info></info>
            </track>
    
            <track>
              <location>mp3/rachmaninov.mp3</location>
              <creator>Rachmaninov</creator>
              <album>Piano Concertos</album>
              <title>Concerto pour Piano (Rachmaninov)</title>
              <annotation></annotation>
              <duration></duration>
              <image>covers/rachma.jpg</image>
              <info></info>
            </track>
    
        </trackList>
    </playlist>
    عايز انا اعمل كدة النظام ده
    الكود الي اريدة



    <?php
    $query = mysql_query(SELECT * FROM etc)or die ();
    $row = mysql_fetch_object($query);
    ?>
    <?xml version="1.0" encoding="UTF-8"?>
    <playlist version="1" xmlns="http://xspf.org/ns/0/">
    <title>Ounage Playlist</title>
    <creator>Dew</creator>
    <link>http://www.blup.fr/</link>
    <info>The Best Playlist for Testing</info>
    <image>covers/tracklist.jpg</image>

    <trackList>

    <track>
    <location>".$row->name."</location>
    <creator>".$row->artist."</creator>
    <album>".$row->album."</album>
    <title>".$row->title."</title>
    <annotation>".$row->ann."</annotation>
    <duration>32000</duration>
    <image>covers/smetana.jpg</image>
    <info></info>
    <link>".$row->link."</link>
    </track>

    <track>
    <location></location>
    <creator>Cesaria Evora</creator>
    <album>Voz d'Amor (Cesaria Evora)</album>
    <title>Saia Travada</title>
    <annotation></annotation>
    <duration></duration>
    <image>covers/cesaria.jpg</image>
    <info></info>
    <link>http://fr.wikipedia.org/wiki/Cesaria_Evora</link>
    </track>

    <track>
    <location>mp3/katusha.mp3</location>
    <creator>Russian Red Army Choir</creator>
    <album>Best Of</album>
    <title>Katusha</title>
    <annotation></annotation>
    <duration></duration>
    <image>covers/redarmy.jpg</image>
    <info></info>
    <link>http://www.blup.fr/</link>
    </track>

    <track>
    <location>mp3/everywhere.mp3</location>
    <creator>Michelle Branch</creator>
    <album>Everywhere</album>
    <title>Everywhere (Michelle Branch)</title>
    <annotation></annotation>
    <duration></duration>
    <image>covers/everywhere.jpg</image>
    <link>http://fr.wikipedia.org/wiki/Michelle_Branch</link>
    </track>

    <track>
    <location>mp3/cartographer-caarano.mp3</location>
    <creator>E.S. Posthumus</creator>
    <album>Cartographer</album>
    <title>Caarano</title>
    <annotation></annotation>
    <duration></duration>
    <image>covers/cartographer.jpg</image>
    <info></info>
    <link>http://www.esposthumus.com/</link>
    </track>

    <track>
    <location>mp3/cartographer-isunova.mp3</location>
    <creator>E.S. Posthumus</creator>
    <album>Cartographer</album>
    <title>Isunova</title>
    <annotation></annotation>
    <duration></duration>
    <image>covers/cartographer.jpg</image>
    <info></info>
    <link>http://www.esposthumus.com/</link>
    </track>

    <track>
    <location>mp3/cartographer-nolitus.mp3</location>
    <creator>E.S. Posthumus</creator>
    <album>Cartographer</album>
    <title>Nolitus</title>
    <annotation></annotation>
    <duration></duration>
    <image>covers/cartographer.jpg</image>
    <info></info>
    <link>http://www.esposthumus.com/</link>
    </track>

    <track>
    <location>mp3/unearthed-nara.mp3</location>
    <creator>E.S. Posthumus</creator>
    <album>Unearthed</album>
    <title>Nara</title>
    <annotation></annotation>
    <duration></duration>
    <image>covers/unearthed.jpg</image>
    <info></info>
    <link>http://www.esposthumus.com/</link>
    </track>

    <track>
    <location>mp3/cortex.mp3</location>
    <creator>Warner Bros</creator>
    <album>Conquérir le Monde</album>
    <title>Minus et Cortex</title>
    <annotation></annotation>
    <duration></duration>
    <image>covers/minus.jpg</image>
    <info></info>
    </track>

    <track>
    <location>mp3/hussard.mp3</location>
    <creator>Jean-Claude Petit</creator>
    <album>Le Hussard sur le Toit</album>
    <title>Le Hussard sur le Toit</title>
    <annotation></annotation>
    <duration></duration>
    <image>covers/hussard.jpg</image>
    <info></info>
    </track>

    <track>
    <location>mp3/vinci.mp3</location>
    <creator>Dan Brown</creator>
    <album>Da Vinci Code</album>
    <title>Da Vinci Code</title>
    <annotation></annotation>
    <duration></duration>
    <image>covers/vinci.jpg</image>
    <info></info>
    </track>

    <track>
    <location>mp3/rachmaninov.mp3</location>
    <creator>Rachmaninov</creator>
    <album>Piano Concertos</album>
    <title>Concerto pour Piano (Rachmaninov)</title>
    <annotation></annotation>
    <duration></duration>
    <image>covers/rachma.jpg</image>
    <info></info>
    </track>

    </trackList>
    </playlist>








  2. #2


    قم بإخراج البيانات بالطريقة العادية و ضع وسوم الxml بالطريقة العادية و كأنها html

    في حال كان الملف xml و يتم جلبه من الفلاش حينها عليك تحويل صيغة الملف من .php إلى .xml بإستخدام الهتيسس htaccess
    مثال :
    كود PHP:
    RewriteEngine on
    RewriteRule 
    ^file.xml  file.php 
    أيضا في أول ملف الـ php ضع ال دالة header لتحويل نوع الملف إلى ملف xml

    كود PHP:
    header('(anti-spam-content-type:) text/xml'); 
    * تحديث : نظام الحماية في سوالف قام بتشويه محتوى الدالة ، و الدالة تجدها هنا

    إجتهد لتصل إلى طرقك الخاصة في المستقبل


    بالتوفيق ،





    التعديل الأخير تم بواسطة خالد الحضري ; 07-12-2010 الساعة 05:17 AM سبب آخر: تنسيق الرد





ضوابط المشاركة

  • لا تستطيع إضافة مواضيع جديدة
  • لا تستطيع الرد على المواضيع
  • لا تستطيع إرفاق ملفات
  • لا تستطيع تعديل مشاركاتك
  •  

أضف موقعك هنا| اخبار السيارات | حراج | شقق للايجار في الكويت | بيوت للبيع في الكويت | دليل الكويت العقاري | مقروء | شركة كشف تسربات المياه | شركة عزل اسطح بالرياض | عزل فوم بالرياض| عزل اسطح بالرياض | كشف تسربات المياة بالرياض | شركة عزل اسطح بالرياض