I get the message
Fatal error: Call to undefined function: simplexml_load_file() in D:\Home\jeeptrophy.com\httpdocs\deneme\xml.inc.php on line 64
when I use it on my server
But the page opens when I use it on my pc
the code:
function processImage($string) {
$strReturn = '<img src=';
if($string=="") {
$strReturn .= '"blank.gif"';
} else {
$pattern = '/src="([:%\w\s.+\/-]+)/';
if(preg_match($pattern, $string, $matches)) {
$strReturn .= '"'.$matches[1].'"';
} else {
$strReturn .= '"'.$string.'"';
}
}
$strReturn .= ' class="thumb" />';
return $strReturn;
}
/**
simplexml_load_file() wrapper
@author Paul Slugocki
@ string $hotelData File location
@return simpleXMLElement
/
function loadXML($hotelData) {
//if($_SERVER['HTTP_HOST']=="tourcmsdev.macbook") {
$fileLoc = $hotelData;
//} else {
// $fileLoc = 'http:/jeeptrophy.com/deneme/xml/'.$hotelData;
//}
$xml = simplexml_load_file($fileLoc);
return $xml;
}
/**
Prints a HTML select box populated based on the
contents of a node named with the value of $field
checks the querystring to set the currently selected
option
@author Paul Slugocki
@ simpleXMLElement $xml
@ string $node the node value(s) to consider
@ string $unfilteredName
@return void
*/
function buildSelect($xml, $node, $unfilteredName) {
$options = array();
$xPath = '/tours/tour/'.$node;
$class = "";
$xml = $xml->xpath($xPath);
print('<select name="'.$node.'"><option value="">'.$unfilteredName.'</option>');
foreach($xml as $value) {
$stringValue = strval($value);
if(!in_array($stringValue, $options) && $stringValue != "")
$options[] = $stringValue;
}
sort($options);
foreach($options as $option) {
print("<option");
if(!empty($_GET[$node])) {
if($_GET[$node]==$option)
print(' selected="selected"');
}
print(">".$option."</option>");
}
print("</select>");
}
function getTourNode($xml) {
$xPath = '/tours/tour[sourceId="'.$_GET['tour'].'"]';
$xml = $xml->xpath($xPath);
return $xml;
}