<?php if($kpid !== '') { ?>
<?php $xml = simplexml_load_file("http://www.kinopoisk.ru/rating/$kpid.xml"); ?>
<?php foreach ($xml->xpath("/rating/kp_rating") as $kpr) { ?>
<?php echo $kpr; ?>
<?php } ?>
<?php foreach ($xml->xpath("/rating/imdb_rating") as $imdb) { ?>
<?php echo $imdb; ?>
<?php } ?>
<?php } ?>
<?
if($kpid){
$xml = simplexml_load_file("http://www.kinopoisk.ru/rating/$kpid.xml");
foreach ($xml->xpath("/rating/kp_rating") as $kpr) {
echo $kpr;
}
foreach ($xml->xpath("/rating/imdb_rating") as $imdb){
echo $imdb;
}
}
?>