first question on stack overflow. I have always been able to find what I am looking for without asking a question, but this has me stumped.
I am upgrading my site to hosting using Amazon cloud. As part of that upgrade, I am deploying my code into what I have labeled my E1 server (Development). I figured this would be a quick process, but am hitting what has proved to be quite a roadblock with if statements in PHP.
I use nested HTML within php if statements to show feedback to users on my site. This worked great on my previous hosting provider, PHP version 5.3.13 and the new server has PHP version 5.3.28.
Here is the code:
$positive_feedback = $_SESSION['letter_update_feedback'];
if($positive_feedback != "")
{
?>
<div class="positivefeedback">
<h3>
<?php
echo $positive_feedback;
$positive_feedback = "";
?>
</h3>
</div>
<?
}
$_SESSION['letter_update_feedback'] = $positive_feedback;
On the new server it fails with this error:
Parse error: syntax error, unexpected $end in /var/www/html/viewletter.php on line 1239
On another note, it works if I remove all native HTML from inside the if statements, and replace them with an echo.
$positive_feedback = $_SESSION['letter_update_feedback'];
if($positive_feedback != "")
{
echo '<div class="positivefeedback">
<h3>';
echo $positive_feedback;
$positive_feedback = "";
echo '</h3>
</div>';
}
$_SESSION['letter_update_feedback'] = $positive_feedback;
Thanks for all the help in advance.