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

PHP

Avatar of undefined
Last Comment
Ray Paseur

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Ray Paseur

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Your help has saved me hundreds of hours of internet surfing.
fblack61