Link to home
Start Free TrialLog in
Avatar of seopti
seopti

asked on

Nowdoc question

This code works fine but as soon as I add a NOWDOC and try to echo it, it will not be parsed at all. All the code will be echoed without parsing.

 <?php
if( $detect->isMobile() && !$detect->isTablet() ){
echo <<<'EOD'


EOD;

}
 else
$now =<<<'EOD'



						  <div class="tab-9 st_view"><div class="st_view_inner">


						  People who viewed {$agentsStuff['bizName']} also viewed:<br><br>


    
                             	

<table class="table table-striped table-responsive table-hover table-condensed">
 

$counter=0;
$result1 = mysql_query("SELECT bizID,bizName,bizAddr,bizCity,bizZip,bizPhone,bizState,lname,fname,category FROM final5 WHERE bizZip = '$bizZip' AND bizState='$bizState' AND bizCity='$bizCity'
GROUP by bizName  HAVING bizID != '$bizID' LIMIT 12");  
 while($r=mysql_fetch_assoc($result1))
{

$bizID =  {$r['bizID']};
$bizName =  {$r['bizName']};
$bizAddr =  {$r['bizAddr']};
$bizCity =  {$r['bizCity']};
$bizZip =  {$r['bizZip']};
$bizPhone =  {$r['bizPhone']};
$bizState =  {$r['bizState']};
$lname =  {$r['lname']};
$fname =  {$r['fname']};
$category =  {$r['category']};

	$bizCityLink = str_replace(" ","-",$bizCity);
	$bizCityLink = strtolower($bizCityLink);
	$bizStateLink = strtolower($bizState);
	$bizNamev = replaceForLink($bizName);

	$defaultString = 'Construction';
			if(replaceForText($fname)=="")
			{
               $bizNameLink = replaceForText($bizName);
	           if(empty($bizNameLink))  $bizNameLink = $defaultString;
}
else
{
               $bizNameLink = replaceForText($fname." ".$lname);
}

  if($counter==0)
                  {
                                      echo "<tr>";
										 }
echo '<td><a href="'. $urlPrefix . $bizStateLink . '/' . $bizCityLink . '/' . $bizNamev . '-' . $bizID . '.html">' . $bizName . '</a><br>

	 '.( (replaceForText($bizName) == $bizNameLink) ? "":replaceForText($fname." ".$lname)." ").' 
'.$category.'

<br>

			</td>';
 if($counter==3)
                  {
                        echo "</tr>";
                        $counter = 0;
                        continue;
                  }
                                  $counter++;
            }

            ?>

		
</table>

EOD;
?>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Ray Paseur
Ray Paseur
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial