I get this error message:
Parse error: parse error, unexpected '=' in c:\Inetpub\wwwroot\xyford\manual\mybook.php on line 46
And here's line 46. The "=" causing the trouble is, I think, the "chapter=" one.
if ($prevPage > $chapters[$chapter][0]) $out .= "<a href="/mybook.php?chapter={$chapter}&page={$prevPage}">Prev</a>";
I can't see what to do about it.
Can anyone help?
Unexpected "=" - why? what to do?
Moderator: General Moderators
Re: Unexpected "=" - why? what to do?
Quotes in strings must be escaped. Otherwise, they prematurely terminate the string.abrogard wrote:Code: Select all
if ($prevPage > $chapters[$chapter][0]) $out .= "<a href="/mybook.php?chapter={$chapter}&page={$prevPage}">Prev</a>";
Code: Select all
if ($prevPage > $chapters[$chapter][0]) $out .= "<a href=\"/mybook.php?chapter={$chapter}&page={$prevPage}\">Prev</a>";