I am using an external script for my site and i found out that it seems there’s a syntax problem when it tries to generate the XML code.
There are no quotes for the 2nd line and it makes the page crashing. How could i solve it? Why did it work for other people? Is it about the PHP version?
$h->xmlrequest = '<?xml version="1.0"?>';
$h->xmlrequest .= <<<END
<a:searchrequest xmlns:a="DAV:" xmlns:s="http://schemas.microsoft.com/exchange/security/">
<a:sql>
SELECT "DAV:displayname"
,"urn:schemas:httpmail:subject"
FROM "$exchange_server/Exchange/aaaaa/inbox"
</a:sql>
</a:searchrequest>
END;
The problem makes the PHP file not ableto be executed and therefore not showing any external output.
Even just trying this makes it crash:
$h->xmlrequest = '<'.'?xml version="1.0"?'.'>';
$h->xmlrequest .= <<<END
END;
Displaying errors this is the error i get:
Parse error: syntax error, unexpected T_SL in C:\inetpub\wwwroot\fromMail\index2.php on line 23
Line 23 is the one of <<< END
Oh, this one is really tricky to spot: You’ve got spare whitespace at the end of the
<<<ENDline:Therefore the ending
doesn’t match anymore.