Jump to content

[SOLVED] script error


alin19

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.