PHP doesn't work with some tags

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

rocklee44
New php-forum User
New php-forum User
Posts: 3
Joined: Mon Mar 24, 2014 12:38 am

PHP doesn't work with some tags

Postby rocklee44 » Mon Mar 24, 2014 12:57 am

Dear all,
Sorry for my confusing subject, I am not a php programmer.
Here is my problem.

I have a playlist.php

Code: Select all

<?
        include("../admin/inc/dbconnect.php");
        include("../admin/inc/common.php");

        $cat_home=gia_tri_mot_cot("tb_bac_1","trang",1,"ma_bac_1");
        $cat_bn_top=gia_tri_mot_cot_2dk("tb_bac_2","ma_bac_1",$cat_home,"trang",63,"ma_bac_2");

        $query="SELECT * FROM tb_news WHERE ma_bac_2=$cat_bn_top and banner='1' and activate='1' and ngoai_index!='1' ORDER BY thu_tu DESC ";
        $result = mysql_query($query);
        $banner="";
        //$lg="vn";
        $lg = $HTTP_GET_VARS["lg"];
        //echo "dfgdfg: $lg";
// third, build the playlist
header("content-type:text/xml;charset=utf-8");
echo "<playlist version='1' xmlns='http://xspf.org/ns/0/'>\n";
echo "<trackList>\n";
while($rs = @mysql_fetch_array($result))
{
                if($lg=="vn")
                        $banner="images/photo/news/$rs[anh_nho]";
                if($lg=="eg")
                        $banner="images/photo/news/$rs[anh]";
                if($lg=="kr")
                        $banner="images/photo/news/$rs[anh_nho_1]";
                $ten=$rs["ten_$lg"];
                $link=$rs["mo_ta_$lg"];

  echo "\t<track>\n";
  echo "\t\t<title>".$ten."</title>\n";
  echo "\t\t<location>".$banner."</location>\n";
  echo "\t\t<info>".$link."</info>\n";
  echo "\t</track>\n";
}
echo "</trackList>\n";
echo "</playlist>\n";
?>


playlist.php is called by another file to create a playlist (flash file) include many picture and display on browser but when I browse index.php it cannot display playlist.
When I enter to browser :

Code: Select all

http://mysite.com/banner_flash_upload_image/playlist.php?lg=vn&amp;transition=lines&amp;allowfullscreen=true&amp;shownavigation=true&amp;overstretch=true&amp;linkfromdisplay=true&amp;width=764&amp;height=250

It show a blank page with text :
\n"; echo "\n"; while($rs = @mysql_fetch_array($result)) { if($lg=="vn") $banner="images/photo/news/$rs[anh_nho]"; if($lg=="eg") $banner="images/photo/news/$rs[anh]"; if($lg=="kr") $banner="images/photo/news/$rs[anh_nho_1]"; $ten=$rs["ten_$lg"]; $link=$rs["mo_ta_$lg"]; echo "\t\n"; echo "\t\t\n"; echo "\t\t".$banner."\n"; echo "\t\t".$link."\n"; echo "\t\n"; } echo "\n"; echo "\n"; ?>


So from the line

Code: Select all

echo "<playlist version='1' xmlns='http://xspf.org/ns/0/'>\n";
php doesn't understand tags

Code: Select all

<playlist> <trackList> <track>
and it assume remain code as text.

I did the searching and found something like
http://www.xspf.org/quickstart/
, I don't know what is XML Shareable Playlist Format and how to fix this problem.
My server : Centos 6.4 64bit , httpd-2.2.15-29.el6.centos.x86_64, php-5.3.3-23.el6_4.x86_64 .
If I need to install any package to get it works ?

Thanks in advanced.
Jack
Last edited by rocklee44 on Mon Mar 24, 2014 1:35 am, edited 1 time in total.

muhammadfahry18
New php-forum User
New php-forum User
Posts: 2
Joined: Mon Mar 24, 2014 1:09 am

Re: PHP doesn't work with some tags

Postby muhammadfahry18 » Mon Mar 24, 2014 1:26 am

Please check your code. Usually, it is fault at double qoutes sir.

Please visit. http://telkomuniversity.ac.id

rocklee44
New php-forum User
New php-forum User
Posts: 3
Joined: Mon Mar 24, 2014 12:38 am

Re: PHP doesn't work with some tags

Postby rocklee44 » Wed Aug 27, 2014 6:07 pm

I find out reason, this is coded a few year ago, since php4, now I use php5 and it not works. I make it work by using fastcgi.


Return to “PHP coding => General”

Who is online

Users browsing this forum: Bing [Bot] and 1 guest