php xml

wawan · Oct 19, 2011
sore bli ellyx, mau tanya lagi nih bli.

saya lagi coba buat script php xml, yang nantinya digunakan untuk pengatur pada image slider.

apa script yang saya buat ini sudah benar atau belum bli?? krna sewaktu saya run image slidernya tidak tampil apa-apa.

mohon bantuannya bli.

<?php
function cleanText($str){
$result = str_ireplace(array("\r","\n","\t"), "", $str);
return $result;
}
mysql_connect("localhost", "root", "");
mysql_select_db("db_wtn");

$namaTabel = "jos_content";

header('Content-Type: text/xml');

$query = "SELECT * FROM $namaTabel ORDER BY id";
$hasil = mysql_query($query);
$jumField = mysql_num_fields($hasil);

echo "<?xml version='1.0'?".">\n";
echo "<cu3er>
	<settings>
		<auto_play>
			<defaults symbol="circular"/>
			<tweenIn x="250" y="120" width="50" height="50" tint="0xFFFFFF" alpha="0.7" />
			<tweenOver alpha="0" />
		</auto_play>
		<general slide_panel_width="500" slide_panel_height="250" ui_visibility_time="2" />
		<prev_button>
		<tweenIn x="860" y="130" width="30" height="30" alpha="0"/>
		<tweenOver alpha="0"/>
		</prev_button>
		
		<next_button>
		<tweenIn x="890" y="130" width="30" height="30" alpha="0"/>
		<tweenOver alpha="0"/>
		</next_button>
		
		<prev_symbol>
		<defaults type="3"/>
		<tweenIn x="860" y="130" alpha="0.5"/>
		<tweenOver time="0.15" x="860" scaleX="1.1" scaleY="1.1"/>
		</prev_symbol>
		
		<next_symbol>
		<defaults type="3"/>
		<tweenIn x="890" y="130" alpha="0.5"/>
		<tweenOver time="0.15" x="890" scaleX="1.1" scaleY="1.1"/>
		</next_symbol>	
		<description>
			<defaults round_corners="20, 20, 20, 20" delay="0.5" heading_text_size="22" heading_text_color="0xffffff" paragraph_text_size="13" paragraph_text_color="0xFFFFFF" heading_text_margin="20, 20, 20, 20" />
			<tweenIn x="520" y="20" width="310" height="200" alpha="0.7" />
			<tweenOut x="520" time="0.5" y="20" alpha="0.2" />
			<tweenOver y="20" x="520" alpha="0.7"/>
		</description>
	</settings>
	
	<slides>\n";

echo "<data>\n";
while ($data = mysql_fetch_array($hasil))
{
   echo "<".$namaTabel.">\n";
   for ($i=0; $i<=$jumField-1; $i++)
   {
      $namaField = mysql_field_name($hasil, $i);
      echo "<".$namaField."><![CDATA[".urlencode(strip_tags($data[$namaField]))."]]></".$namaField.">\n";
   }
   echo "</".$namaTabel.">\n";
}
echo "</data>\n";
echo "		<transition num="4" direction="left" shader="flat" z_multiplier="0.8" delay="0.05"/>	
	</slides>
</cu3er>";

?>
Silahkan login untuk menjawab!
0
Loading...
Ellyx Christian · Oct 19, 2011 · 0 Suka · 0 Tidak Suka
<?php
function cleanText($str){
$result = str_ireplace(array("\r","\n","\t"), "", $str);
return $result;
}
mysql_connect("localhost", "root", "");
mysql_select_db("db_wtn");
 
$namaTabel = "jos_content";
 
header('Content-Type: text/xml');
 
$query = "SELECT * FROM $namaTabel ORDER BY id";
$hasil = mysql_query($query);
$jumField = mysql_num_fields($hasil);
 
echo "<?xml version='1.0'?".">\n";
echo '<cu3er>
	<settings>
		<auto_play>
			<defaults symbol="circular"/>
			<tweenIn x="250" y="120" width="50" height="50" tint="0xFFFFFF" alpha="0.7" />
			<tweenOver alpha="0" />
		</auto_play>
		<general slide_panel_width="500" slide_panel_height="250" ui_visibility_time="2" />
		<prev_button>
		<tweenIn x="860" y="130" width="30" height="30" alpha="0"/>
		<tweenOver alpha="0"/>
		</prev_button>
 
		<next_button>
		<tweenIn x="890" y="130" width="30" height="30" alpha="0"/>
		<tweenOver alpha="0"/>
		</next_button>
 
		<prev_symbol>
		<defaults type="3"/>
		<tweenIn x="860" y="130" alpha="0.5"/>
		<tweenOver time="0.15" x="860" scaleX="1.1" scaleY="1.1"/>
		</prev_symbol>
 
		<next_symbol>
		<defaults type="3"/>
		<tweenIn x="890" y="130" alpha="0.5"/>
		<tweenOver time="0.15" x="890" scaleX="1.1" scaleY="1.1"/>
		</next_symbol>	
		<description>
			<defaults round_corners="20, 20, 20, 20" delay="0.5" heading_text_size="22" heading_text_color="0xffffff" paragraph_text_size="13" paragraph_text_color="0xFFFFFF" heading_text_margin="20, 20, 20, 20" />
			<tweenIn x="520" y="20" width="310" height="200" alpha="0.7" />
			<tweenOut x="520" time="0.5" y="20" alpha="0.2" />
			<tweenOver y="20" x="520" alpha="0.7"/>
		</description>
	</settings>
 
	<slides>'."\n";
 
echo "<data>\n";
while ($data = mysql_fetch_array($hasil))
{
   echo "<".$namaTabel.">\n";
   for ($i=0; $i<=$jumField-1; $i++)
   {
      $namaField = mysql_field_name($hasil, $i);
      echo "<".$namaField."><![CDATA[".urlencode(strip_tags($data[$namaField]))."]]></".$namaField.">\n";
   }
   echo "</".$namaTabel.">\n";
}
echo "</data>\n";
echo '		<transition num="4" direction="left" shader="flat" z_multiplier="0.8" delay="0.05"/>	
	</slides>
</cu3er>';
 
?>
pelajari http://www.myphptutorials.com/tutorials/5/php-dasar-string-number-konstanta
0
Loading...
wawan · Oct 19, 2011 · 0 Suka · 0 Tidak Suka
memang script saya salah dimananya bli??
0
Loading...
Ellyx Christian · Oct 19, 2011 · 0 Suka · 0 Tidak Suka
lihat saja bedanya.