can not display the xml from form combo

Dear Sir,

I have the tabbar attach the form. Some of the form field is combo. I create the getCombo.php to get XML

form field:

{ type:"combo" , name:"test", label:"test :",connector:"getCombo1.php?s1=id&s2=Name&table=testTable"}

getCombo1.php:

[code]<?php

$table=$_GET[table];
$s1=$_GET[s1];
$s2=$_GET[s2];

require_once(“…/lib/config.php”);
$res=mysql_connect($mysql_server,$mysql_user,$mysql_pass);
mysql_select_db($mysql_db);

function getCombo1($table,$s1,$s2){
echo (“”);
echo (" “);
echo (” “) ;
echo (” “);
echo (” “);
echo (”“);
$sql1 = “select $s1,$s2 from $table”;
$res1 = mysql_query ($sql1);
if($res1){
while($row1=mysql_fetch_array($res1)){
print (” <$s2>$row1[$s2]</$s2> “);
}
}else{
echo mysql_errno().”: “.mysql_error().” at “.LINE.” line in “.FILE.” file
";
}
}

header(“Content-Type: text/xml”);
//XML HEADER
/*
if ( stristr($_SERVER[“HTTP_ACCEPT”],“application/xhtml+xml”) ) {
header(“Content-type: application/xhtml+xml”);
}
else {
header(“Content-type: text/xml”);
}
*/
echo (“<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n”);
echo (“”);

getCombo1($table,$s1,$s2);

mysql_close($res);

echo (“”);
?>[/code]

But when I use the link in brower. it has a error just like the img. but another combo can display the result.

Please help to tell me what the problem is .

thank you.


Hi,

Most probably you have some problem with encoding.
Double-check that data in DB is really in UTF encoding. if it is not so, you can fix the data in DB or change the encoding name in XML header to the actual one.