Advertisement
Guest User

Untitled

a guest
Apr 8th, 2014
233
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 18.71 KB | None | 0 0
  1. <?php
  2. ini_set('max_execution_time', 300);
  3. $errmsg_arr = array();
  4. $errflag = false;
  5. $link;
  6. include ('simple_html_dom.php');
  7.  
  8. function db_connect()
  9. {
  10.   define('DB_HOST', 'localhost');
  11.   define('DB_USER', 'root');
  12.   define('DB_PASSWORD', 'root');
  13.   define('DB_DATABASE', 'tv');
  14.    
  15.   $errmsg_arr = array();
  16.   $errflag = false;
  17.   $link = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD);
  18.  
  19.   if(!$link)
  20.   {
  21.     die('Failed to connect to server: ' . mysql_error());
  22.   }
  23.  
  24.   $db = mysql_select_db(DB_DATABASE);
  25.   if(!$db)
  26.   {
  27.     die("Unable to select database");
  28.   }
  29. }
  30.  
  31. function getUrlFriendlyString($str)
  32. {
  33.     // convert spaces to '-', remove characters that are not alphanumeric
  34.     // or a '-', combine multiple dashes (i.e., '---') into one dash '-'.
  35.     $str = ereg_replace("[-]+", "-", ereg_replace("[^a-z0-9-]", "",
  36.             strtolower( str_replace(" ", "-", $str) ) ) );
  37.     return $str;
  38. }
  39.  
  40. db_connect();
  41.  
  42.   function clean($var)
  43.   {
  44.     return mysql_real_escape_string(strip_tags($var));
  45.   }
  46.   $channels = "";
  47.   $id = "";
  48.  
  49.   if(isset($_GET['channels'])){
  50.     $channels = clean($_GET['channels']);
  51.   }
  52.   if(isset($_GET['id'])){
  53.     $id = clean($_GET['id']);
  54.   }
  55.  
  56.   if($errflag)
  57.   {
  58.     $_SESSION['ERRMSG_ARR'] = $errmsg_arr;
  59.     echo implode('<br />',$errmsg_arr);
  60.   }
  61.   else
  62.   {
  63.     $insert = array();
  64.  
  65.     if(isset($_GET['channels']))
  66.     {
  67.       $insert[] = 'channels = \'' . clean($_GET['channels']) .'\'';
  68.     }
  69.     if(isset($_GET['id']))
  70.     {
  71.       $insert[] = 'id = \'' . clean($_GET['id']) . '\'';
  72.     }
  73.    
  74.     $base1 = "http://localhost/free/myscrip/get-listing.php";
  75.    
  76.    
  77.    
  78.     $html = file_get_html($base1);   
  79.    
  80.    
  81.    
  82.    
  83. $countp = $html->find('p');    
  84. header("Content-type: text/xml");
  85. echo "<?xml version='1.0' encoding='UTF-8'?>";
  86. echo '<tv generator-info-name="www.testbox.elementfx.com/xmltv">';
  87.  
  88. for ($i=30 ;$i<count($countp) ; $i=$i+2)   
  89. {
  90. echo '<channel id="'.$countp[$i]->innertext.'">' .'<display-name>'.$countp[$i]->innertext.'</display-name>';
  91.  
  92.     $htmlinner = file_get_html($countp[$i+1]->children(0)->innertext);
  93.     $countpinner = $htmlinner->find('span');
  94.        
  95.     for ($iinner=0 ;$iinner<count($countpinner) ; $iinner = $iinner+2){  
  96.    
  97.     $start_time_pr =  date("Ymd");
  98.     $end_time_pr = date("Ymd");
  99.     $start_time_pr .=  date("His", strtotime($countpinner[$iinner]->innertext)  );
  100.    
  101.     if ($iinner +2 <count($countpinner) )
  102.     $end_time_pr .= date("His", strtotime($countpinner[$iinner+2]->innertext ));
  103.     else
  104.     $end_time_pr .=  "000000" ;
  105.    
  106.     echo '<programme channel="'.$countp[$i]->innertext.'" start="'.$start_time_pr.'" stop="'.$end_time_pr.'">';  
  107.     echo '<title lang="en"/>'.$countpinner[$iinner+1]->innertext.'';
  108.     echo '<sub-title lang="en"></sub-title>';
  109.     echo '<desc lang="en"/>';
  110.     echo '<category lang="en"/>';
  111.     echo '</programme>';
  112.     }
  113. echo '</channel>';
  114. }
  115. echo "</tv>";
  116.    
  117.     exit;    
  118.    
  119.     $curl1 = curl_init();
  120.     curl_setopt($curl1, CURLOPT_SSL_VERIFYPEER, FALSE);
  121.     curl_setopt($curl1, CURLOPT_HEADER, false);
  122.     curl_setopt($curl1, CURLOPT_FOLLOWLOCATION, true);
  123.     curl_setopt($curl1, CURLOPT_URL, $base1);
  124.     curl_setopt($curl1, CURLOPT_REFERER, $base1);
  125.     curl_setopt($curl1, CURLOPT_RETURNTRANSFER, TRUE);
  126.     $str1 = curl_exec($curl1);
  127.     curl_close($curl1);
  128.    
  129.     echo var_dump( $str1);
  130.     exit;
  131.    
  132.     // Create a DOM object
  133.     $html = new simple_html_dom();
  134.     // Load HTML from a string
  135.     $html->load($str1);
  136.    
  137.     //$html = file_get_html("http://localhost/free/myscrip/get-listing.php");
  138.  
  139.     // Find all images
  140.     $program_list = array();
  141.     $count = 0;
  142.     echo  $html;
  143.     // echo var_dump( $html->find('nodetype'));
  144.     exit;
  145.  
  146.     foreach($html->find('p[id=links]') as $element)
  147.     {
  148.        $program_list[ $count ] = array();
  149.        $temp_arr = explode("?", $element->plaintext);
  150.        $temp_arr = explode("&", $temp_arr[1]);
  151.        $channels = explode("channels=",$temp_arr[0]);
  152.        $channels = $channels[1];
  153.        $id = explode("id=",$temp_arr[1]);
  154.        $id = $id[1];
  155.        echo $temp_arr;
  156.  
  157.        $program_list[ $count ]['channels'] = $channels;
  158.        $program_list[ $count ]['id'] = $id;
  159.    
  160.        $html_two = ""; 
  161.        //$tmp = explode("?", $element->plaintext);
  162.        $tmp = explode("?", $element->plaintext);
  163.        $tmp = explode("&", $tmp[1] );
  164.        $tmpch = explode("channels=",$tmp[0]);
  165.        $tmpch = $tmpch[1];
  166.        $tmpid = explode("id=",$tmp[1]);
  167.        $tmpid = $tmpid[1];
  168.            
  169.        $tempch = urlencode($tmpch);
  170.        $tempid = urlencode($tmpid);
  171.            
  172.        /*$url = "http://localhost/free/myscrip/get-listing.php?channels=" . $tempch . "&id=" . $tmpid;
  173.            
  174.        $html_two = new simple_html_dom();      
  175.        $dom = $html_two->load_file($url);
  176.        
  177.        if(empty($dom))
  178.        {
  179.          continue;
  180.        }*/
  181.            
  182.        /*$base2 = "http://localhost/free/myscrip/get-listing.php?channels=" . $tempch . "&id=" . $tmpid;       
  183.        $curl2 = curl_init();
  184.        curl_setopt($curl2, CURLOPT_SSL_VERIFYPEER, FALSE);
  185.        curl_setopt($curl2, CURLOPT_HEADER, false);
  186.        curl_setopt($curl2, CURLOPT_FOLLOWLOCATION, true);
  187.        curl_setopt($curl2, CURLOPT_URL, $base2);
  188.        curl_setopt($curl2, CURLOPT_REFERER, $base2);
  189.        curl_setopt($curl2, CURLOPT_RETURNTRANSFER, TRUE);
  190.        $str2 = curl_exec($curl2);
  191.        curl_close($curl2);
  192.            
  193.        // Create a DOM object
  194.        $html_two = new simple_html_dom();
  195.        // Load HTML from a string
  196.        $html_two->load($str2);*/
  197.        
  198.        $html_two = file_get_html("http://localhost/free/myscrip/get-listing.php?channels=" . $tempch . "&id=" . $tmpid);
  199.        $html_two_counter = count($html_two->find('span[id=time1]'));
  200.        
  201.        if($html_two_counter == 0)
  202.        {
  203.           continue;
  204.        }
  205.            
  206.        
  207.        //$html_two = file_get_html($url);      
  208.        
  209.        $time1 = $html_two->find('span[id=time1]',0)->plaintext;
  210.        $title1 = $html_two->find('span[id=title1]',0)->plaintext;
  211.        
  212.        $time1 = explode(" ", $time1);
  213.        $hoursMinutes = explode(":", $time1[0]);
  214.        $hours = $hoursMinutes[0];
  215.        $minutes = $hoursMinutes[1];
  216.        
  217.        if($time1[1] == "PM")
  218.        {
  219.       $time1[0] = date("Ymd") . ((int)($hours) + 12) . $minutes . "00";
  220.        }
  221.        else
  222.        {
  223.       $time1[0] = date("Ymd") . $hours . $minutes . "00";
  224.        }
  225.        
  226.        $program_list[$count]['start_time1'] = $time1[0];
  227.        $program_list[$count]['title1'] = $title1;  
  228.        
  229.        //time2
  230.        $time2 = $html_two->find('span[id=time2]', 0)->plaintext;
  231.        $title2 = $html_two->find('span[id=title2]', 0)->plaintext;
  232.        
  233.        $time2 = explode(" ", $time2);
  234.        $hoursMinutes = explode(":", $time2[0]);
  235.        $hours = $hoursMinutes[0];
  236.        $minutes = $hoursMinutes[1];
  237.    
  238.        if($time2[1] == "PM")
  239.        {
  240.       $time2[0] = date("Ymd") . ((int)($hours) + 12) . $minutes . "00";
  241.        }
  242.        else
  243.        {
  244.       $time2[0] = date("Ymd") . $hours . $minutes . "00";
  245.        }
  246.        
  247.        $program_list[$count]['end_time1'] = $time2[0];
  248.        $program_list[$count]['start_time2'] = $time2[0];
  249.        $program_list[$count]['title2'] = $title2;
  250.        
  251.        //time3
  252.        $time3 = $html_two->find('span[id=time3]', 0)->plaintext;
  253.        $title3 = $html_two->find('span[id=title3]', 0)->plaintext;
  254.        
  255.        $time3 = explode(" ", $time3);
  256.        $hoursMinutes = explode(":", $time3[0]);
  257.        $hours = $hoursMinutes[0];
  258.        $minutes = $hoursMinutes[1];
  259.        
  260.        if($time3[1] == "PM")
  261.        {
  262.       $time3[0] = date("Ymd") . ((int)($hours) + 12) . $minutes . "00";
  263.        }
  264.        else
  265.        {
  266.       $time3[0] = date("Ymd") . $hours . $minutes . "00";
  267.        }
  268.        
  269.        $program_list[$count]['end_time2'] = $time3[0];
  270.        $program_list[$count]['start_time3'] = $time3[0];
  271.        $program_list[$count]['title3'] = $title3;
  272.        
  273.        //time4
  274.        $time4 = $html_two->find('span[id=time4]', 0)->plaintext;
  275.        $title4 = $html_two->find('span[id=title4]', 0)->plaintext;
  276.        
  277.        $time4 = explode(" ", $time4);
  278.        $hoursMinutes = explode(":", $time4[0]);
  279.        $hours = $hoursMinutes[0];
  280.        $minutes = $hoursMinutes[1];
  281.        
  282.        if($time4[1] == "PM")
  283.        {
  284.       $time4[0] = date("Ymd") . ((int)($hours) + 12) . $minutes . "00";
  285.        }
  286.        else
  287.        {
  288.       $time4[0] = date("Ymd") . $hours . $minutes . "00";
  289.        }
  290.        
  291.        $program_list[$count]['end_time3'] = $time4[0];
  292.        $program_list[$count]['start_time4'] = $time4[0];
  293.        $program_list[$count]['title4'] = $title4;
  294.        
  295.        //time5
  296.        $time5 = $html_two->find('span[id=time5]', 0)->plaintext;
  297.        $title5 = $html_two->find('span[id=title5]', 0)->plaintext;
  298.        
  299.        $time5 = explode(" ", $time5);
  300.        $hoursMinutes = explode(":", $time5[0]);
  301.        $hours = $hoursMinutes[0];
  302.        $minutes = $hoursMinutes[1];
  303.        
  304.        if($time5[1] == "PM")
  305.        {
  306.       $time5[0] = date("Ymd") . ((int)($hours) + 12) . $minutes . "00";
  307.        }
  308.        else
  309.        {
  310.       $time5[0] = date("Ymd") . $hours . $minutes . "00";
  311.        }
  312.        
  313.        $program_list[$count]['end_time4'] = $time5[0];
  314.        $program_list[$count]['start_time5'] = $time5[0];
  315.        $program_list[$count]['title5'] = $title5;
  316.        
  317.        //time6
  318.        $time6 = $html_two->find('span[id=time6]', 0)->plaintext;
  319.        $title6 = $html_two->find('span[id=title6]', 0)->plaintext;
  320.        
  321.        $time6 = explode(" ", $time6);
  322.        $hoursMinutes = explode(":", $time6[0]);
  323.        $hours = $hoursMinutes[0];
  324.        $minutes = $hoursMinutes[1];
  325.        
  326.        if($time6[1] == "PM")
  327.        {
  328.       $time6[0] = date("Ymd") . ((int)($hours) + 12) . $minutes . "00";
  329.        }
  330.        else
  331.        {
  332.       $time6[0] = date("Ymd") . $hours . $minutes . "00";
  333.        }
  334.        
  335.        $program_list[$count]['end_time5'] = $time6[0];
  336.        $program_list[$count]['start_time6'] = $time6[0];
  337.        $program_list[$count]['title6'] = $title6;
  338.        
  339.        //time7
  340.        $time7 = $html_two->find('span[id=time7]', 0)->plaintext;
  341.        $title7 = $html_two->find('span[id=title7]', 0)->plaintext;
  342.  
  343.        $time7 = explode(" ", $time7);
  344.        $hoursMinutes = explode(":", $time7[0]);
  345.        $hours = $hoursMinutes[0];
  346.        $minutes = $hoursMinutes[1];
  347.        
  348.        if($time7[1] == "PM")
  349.        {
  350.       $time7[0] = date("Ymd") . ((int)($hours) + 12) . $minutes . "00";
  351.        }
  352.        else
  353.        {
  354.       $time7[0] = date("Ymd") . $hours . $minutes . "00";
  355.        }
  356.        
  357.        $program_list[$count]['end_time6'] = $time7[0];
  358.        $program_list[$count]['start_time7'] = $time7[0];
  359.        $program_list[$count]['title7'] = $title7;
  360.        
  361.        //time8
  362.        $time8 = $html_two->find('span[id=time8]', 0)->plaintext;
  363.        $title8 = $html_two->find('span[id=title8]', 0)->plaintext;
  364.  
  365.        $time8 = explode(" ", $time8);
  366.        $hoursMinutes = explode(":", $time8[0]);
  367.        $hours = $hoursMinutes[0];
  368.        $minutes = $hoursMinutes[1];
  369.        
  370.        if($time8[1] == "PM")
  371.        {
  372.       $time8[0] = date("Ymd") . ((int)($hours) + 12) . $minutes . "00";
  373.        }
  374.        else
  375.        {
  376.       $time8[0] = date("Ymd") . $hours . $minutes . "00";
  377.        }
  378.        
  379.        $program_list[$count]['end_time7'] = $time8[0];
  380.        $program_list[$count]['start_time8'] = $time8[0];
  381.        $program_list[$count]['title8'] = $title8;
  382.        
  383.        //time9
  384.        
  385.        
  386.        
  387.        $time9 = $html_two->find('span[id=time9]', 0)->plaintext;
  388.        
  389.            
  390.        $title9 = $html_two->find('span[id=title9]', 0)->plaintext;
  391.            
  392.        $time9 = explode(" ", $time9);
  393.        $hoursMinutes = explode(":", $time9[0]);
  394.        $hours = $hoursMinutes[0];
  395.        $minutes = $hoursMinutes[1];
  396.        
  397.        if($time9[1] == "PM")
  398.        {
  399.       $time9[0] = date("Ymd") . ((int)($hours) + 12) . $minutes . "00";
  400.        }
  401.        else
  402.        {
  403.       $time9[0] = date("Ymd") . $hours . $minutes . "00";
  404.        }
  405.        
  406.        $program_list[$count]['end_time8'] = $time9[0];
  407.        $program_list[$count]['start_time9'] = $time9[0];
  408.        $program_list[$count]['title9'] = $title9;
  409.        $count++;
  410.     }
  411.     var_dump($program_list);
  412.    
  413.     $xml = "<?xml version='1.0' encoding='UTF-8' ?>
  414. <tv generator-info-name='www.testbox.elementfx.com/xmltv'>";
  415.    
  416.     for($i = 0; $i < count($program_list); $i++)
  417.     {
  418.        if(!isset($program_list[$i]['start_time1']))
  419.        {
  420.           continue;
  421.        }
  422.        
  423.        $xml .= "<channel id='" . $program_list[$i]['channels'] . "'>";
  424.        $xml .= "<display-name>" . $program_list[$i]['channels'] . "</display-name>";
  425.        $xml .= "<programme channel='" . $program_list[$i]['channels'] . "' start='" . $program_list[$i]['start_time1'] . "' stop='" . $program_list[$i]['end_time1'] . "'>";
  426.        $xml .= "<title lang='en'></title>";
  427.        $xml .= "<sub-title lang='en'></sub-title>";
  428.        $xml .= "<desc lang='en'></desc>";
  429.        $xml .= "<category lang='en'></category>";
  430.        $xml .= "</programme>\n";
  431.    
  432.        $xml .= "<programme channel='" . $program_list[$i]['channels'] . "' start='" . $program_list[$i]['start_time2'] . "' stop='" . $program_list[$i]['end_time2'] . "'>";
  433.       $xml .= "<title lang='en'></title>";
  434.       $xml .= "<sub-title lang='en'></sub-title>";
  435.       $xml .= "<desc lang='en'></desc>";
  436.       $xml .= "<category lang='en'></category>";
  437.       $xml .= "</programme>\n";
  438.        
  439.        
  440.       $xml .= "<programme channel='" . $program_list[$i]['channels'] . "' start='" . $program_list[$i]['start_time3'] . "' stop='" . $program_list[$i]['end_time3'] . "'>";
  441.       $xml .= "<title lang='en'></title>";
  442.       $xml .= "<sub-title lang='en'></sub-title>";
  443.       $xml .= "<desc lang='en'></desc>";
  444.       $xml .= "<category lang='en'></category>";
  445.       $xml .= "</programme>\n";
  446.        
  447.        
  448.       $xml .= "<programme channel='" . $program_list[$i]['channels'] . "' start='" . $program_list[$i]['start_time4'] . "' stop='" . $program_list[$i]['end_time4'] . "'>";
  449.       $xml .= "<title lang='en'></title>";
  450.       $xml .= "<sub-title lang='en'></sub-title>";
  451.       $xml .= "<desc lang='en'></desc>";
  452.       $xml .= "<category lang='en'></category>";
  453.       $xml .= "</programme>\n";
  454.        
  455.       $xml .= "<programme channel='" . $program_list[$i]['channels'] . "' start='" . $program_list[$i]['start_time5'] . "' stop='" . $program_list[$i]['end_time5'] . "'>";
  456.       $xml .= "<title lang='en'></title>";
  457.       $xml .= "<sub-title lang='en'></sub-title>";
  458.       $xml .= "<desc lang='en'></desc>";
  459.       $xml .= "<category lang='en'></category>";
  460.       $xml .= "</programme>\n";
  461.        
  462.  
  463.       $xml .= "<programme channel='" . $program_list[$i]['channels'] . "' start='" . $program_list[$i]['start_time6'] . "' stop='" . $program_list[$i]['end_time6'] . "'>";
  464.       $xml .= "<title lang='en'></title>";
  465.       $xml .= "<sub-title lang='en'></sub-title>";
  466.       $xml .= "<desc lang='en'></desc>";
  467.       $xml .= "<category lang='en'></category>";
  468.       $xml .= "</programme>\n";
  469.        
  470.       $xml .= "<programme channel='" . $program_list[$i]['channels'] . "' start='" . $program_list[$i]['start_time7'] . "' stop='" . $program_list[$i]['end_time7'] . "'>";
  471.       $xml .= "<title lang='en'></title>";
  472.       $xml .= "<sub-title lang='en'></sub-title>";
  473.       $xml .= "<desc lang='en'></desc>";
  474.       $xml .= "<category lang='en'></category>";
  475.       $xml .= "</programme>\n";
  476.        
  477.  
  478.       $xml .= "<programme channel='" . $program_list[$i]['channels'] . "' start='" . $program_list[$i]['start_time8'] . "' stop='" . $program_list[$i]['end_time8'] . "'>";
  479.       $xml .= "<title lang='en'></title>";
  480.       $xml .= "<sub-title lang='en'></sub-title>";
  481.       $xml .= "<desc lang='en'></desc>";
  482.       $xml .= "<category lang='en'></category>";
  483.       $xml .= "</programme>\n";
  484.        
  485.       $xml .= "<programme channel='" . $program_list[$i]['channels'] . "' start='" . $program_list[$i]['start_time9'] . "' stop=''>";
  486.       $xml .= "<title lang='en'></title>";
  487.       $xml .= "<sub-title lang='en'></sub-title>";
  488.       $xml .= "<desc lang='en'></desc>";
  489.       $xml .= "<category lang='en'></category>";
  490.       $xml .= "</programme>";
  491.       $xml .= "</channel>\n";
  492.     }
  493.     $xml .= "</tv>";
  494.    
  495.     header("Content-Type: text/xml");
  496.     echo $xml;
  497.     $handle = fopen("myChannel.xml", "w");
  498.     fwrite ($handle, $xml);
  499.    
  500.     exit;
  501.    
  502.     if(!$channels && ! $id)
  503.     {
  504.       $qrytable1="SELECT id, channels, links, streams FROM tvguide";
  505.       $result1=mysql_query($qrytable1) or die('Error:<br />' . $qry . '<br />' . mysql_error());
  506.      
  507.       while ($row = mysql_fetch_array($result1))
  508.       {
  509.         // fake some example data. the actual data would be retrieved from a database query
  510.         $data[] = array('channel_id'=>$row['channels'],
  511.         'display_name'=>$row['channels'],
  512.         'program_id'=>123,'start'=>'s1','stop'=>'e1',
  513.         'title'=>'program title',
  514.          'sub_title'=>'sub title',
  515.          'description'=>'program description1',
  516.          'category'=>'some category');
  517.  
  518.  
  519.  
  520.         // build the xml    
  521.         $xml = '<?xml version="1.0" encoding="UTF-8" ?>
  522. <tv generator-info-name="www.testbox.elementfx.com/xmltv">';
  523.         $last_channel = null; // used to detect when the channel changes
  524.        
  525.         foreach($data as $arr)
  526.         {
  527.            if($last_channel != $arr['channel_id'])
  528.            {
  529.               // the channel changed
  530.               if($last_channel != null)
  531.               {
  532.                 // not the first channel, close out the previous channel
  533.                 $xml .= "
  534. </channel> \n";
  535.               }
  536.               // start a new channel
  537.               $xml .= "
  538. <channel id=\"{$arr['channel_id']}\">";
  539.               $xml .= "
  540.   <display-name>{$arr['display_name']}</display-name>";
  541.               $last_channel = $arr['channel_id'];
  542.             }
  543.            
  544.             // output the program info under each channel
  545.             $xml .= "
  546.   <programme channel=\"{$arr['channel_id']}\" start=\"{$arr['start']}\" stop=\"{$arr['stop']}\">";
  547.             // i don't see a program id in this definition, but it likely needs one
  548.             $xml .= "
  549.       <title lang=\"en\">{$arr['title']}</title>";
  550.             $xml .= "
  551.       <sub-title lang=\"en\">{$arr['sub_title']}</sub-title>";
  552.             $xml .= "
  553.       <desc lang=\"en\">{$arr['description']}</desc>";
  554.             $xml .= "
  555.       <category lang=\"en\">{$arr['category']}</category>";
  556.             $xml .= "
  557.   </programme>";
  558.         }
  559.         if($last_channel != null)
  560.         {
  561.            // close out the previous channel if any
  562.            $xml .= '
  563. </channel>';
  564.         }
  565.      }
  566.    }
  567.    $xml .= '
  568. </tv>';
  569.    // output the xml to the browser in this example, write $xml to a file here...
  570.    header("Content-Type: text/xml");
  571.    echo $xml;
  572.    ?>
  573.    <!-- <html>
  574.       <script>
  575.          setTimeout(function(){location.href = "myChannel.xml";},1000){
  576.      }
  577.       </script>
  578.    </html> -->
  579.    <?php
  580.    $handle = fopen("myChannel.xml", "w");
  581.    fwrite ($handle, $xml);
  582.  }
  583. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement