Hi guys

i'm in the process of writing an API and is stuck.

I get this error:

Parse error: syntax error, unexpected T_STRING in /var/www/xxxxxxx.xxx/public_html/api/uentry.php on line 35

Here's the code:

include '../../cfg/xmlhttpheader.inc';
// ---- Form l:
// ---- 1) Rense parameter streng 
// ---- 2) Omdirigere forspørgsler til /api
// include '../../api/uhandler.php';
$RqOK = false;
$success = '';
$Errnr = 0;
$Rspmsg = '';
if (isset($_POST['RqID']))  // unders ger om request parametren er sat
  $RqID = $_POST['RqID'];
    if (strlen($RqID) > 0) // hvis ja, unders ger om den har noget indhold
     $RqOK = true;
     $success = 'n';
     $Errnr = 1000;
     $Rspmsg = 'Ulovligt fors g p  adgang til sitet! K rsel afbrudt';
 } // end if isset($_POST['RqID'])
 if ($RqOK)
  // redirect to api entry
  $success = 'n';
  $Errnr = 1001;
  $Rspmsg = 'Ulovlig forespørgsel, kørsel afbrudt';
<?xml version="1.0" encoding="UTF-8"?>   **// LINE 35**        
<!DOCTYPE Response>
  <Succes><?php echo($success)?></Succes>
  <Ernr><?php echo($Errnr)?></Ernr>
  <Msg><?php echo($Rspmsg)?></Msg>


What am I missing?

Any suggestions?

I know the question has been raised before, but going through the answers and searching the manual has got me nowhere.

Recommended Answers

All 2 Replies

I'd output the xml tag in an echo statement. My guess is it thinks the <? is opening PHP tags. Try:

<?php echo '<?xml version="1.0" encoding="UTF-8"?>'; ?>


Bingo :) it works. Thanks for the pointer.

It must be a server setting thing, because on my local host the script ran smoothly.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.