开发者

embedding html in php error

I think I have a syntax error but I can't spot it, any ideas?

if($infozz['count'] <= $infozz['limit'])
{
mail($infozz['email'], "Your incident report copy!", $bodyz);

echo <<<EOT
<html>

<head>

<title> Summary Report </title>
<link rel="stylesheet" href="http://web.njit.edu/~swp5/assignment/style/style3.css">
</head>

<body>

<div class="header">
Summary Report

</div>

<div class="mess"> 

Type of incident: {$infoz['type']}<br><br>

Date upon entry: {$infoz['date']}<br><br>

Time upon entry: {$infoz['time']}<br><br>

Your account name: {$infoz['reporter']}<br><br>

Your incident ID number: {$infoz['ID']}<br><br>

Your description of the incident: {$infoz['desc'开发者_开发问答]}<br><br>

An email has been sent to your account<br>


</div>

</body>
</html>

EOT;

}


You cannot have any whitespace before or after the close of a HEREDOC statement. Be sure there is no space before or after your EOT; on this line:

EOT;


Don't echo out html.

PHP and HTML should look like this.

<? 
  if ($something == true) {
?>
  <p>HTML Goes here</p>
<?
  }
?>


You didn't close your {}'s for your If statement. Also supply an alternate else of else if statement with your HTML in between the statements

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜