alin19 Posted September 12, 2008 Share Posted September 12, 2008 same script works on one coputer and it gives me an error on the second one, why? Parse error: syntax error, unexpected T_STRING in C:\xampp\htdocs\xml\verifica.php on line 29 <?php define('DOCXML','utilizatori.xml'); header('Content-type : text/xml'); function verifica($un_nume) { $dom=new DOMDocument(); $dom->load(DOCXML); if (!$dom) { return 0; } $radacina=$dom->documentElement; $utilizatori=$radacina->getElementsByTagName('utilizator'); foreach ($utilizatori as $utilizator) { $nume=$utilizator->getElementsByTagName('nume'); if (!strcasecmp ($un_nume,$nume->item(0)->nodeValue)) { return 1; } } return 0; } $y=verifica($_REQUEST['nume']); header('Content-Type: text/xml'); ?> <?xml version="1.0"?>//here is the error <raspuns> <metoda>verificaNume</metoda> <rezultat><?php echo $y; ?></rezultat> </raspuns> Link to comment https://forums.phpfreaks.com/topic/123924-solved-script-error/ Share on other sites More sharing options...
PFMaBiSmAd Posted September 12, 2008 Share Posted September 12, 2008 Because the short_open_tag setting is on and the php parser was never made smart enough to know that <?xml is not a short open tag. You need to use php and echo the line <?xml version="1.0"?> Link to comment https://forums.phpfreaks.com/topic/123924-solved-script-error/#findComment-639712 Share on other sites More sharing options...
alin19 Posted September 12, 2008 Author Share Posted September 12, 2008 i have installed xampp and php 5.2.6 that i use for cli and i had bouth php_xmldom loaded and i think that was the problem ,coment the one in php php 5.2.6 and now is working, 10x Link to comment https://forums.phpfreaks.com/topic/123924-solved-script-error/#findComment-639729 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.